-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
31 lines (27 loc) · 989 Bytes
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const {src, dest, watch} = require("gulp");
const postcss = require("gulp-postcss");
const postcssPresetEnv = require('postcss-preset-env');
const atImport = require("postcss-import");
const rename = require("gulp-rename")
const concat = require("gulp-concat");
const log = require("fancy-log");
require('dotenv').config();
function processCSS() {
return src("./styles/index.css")
.pipe(postcss([atImport, postcssPresetEnv({features: {
'nesting-rules': true
}})]))
.on('end', () => log('PostCSS processing finished'))
.pipe(concat("obsidian.css"))
.on('end', () => log('Output concatenated'))
.pipe(dest("./"))
.pipe(rename("./Rmaki-Obsidian.css"))
.pipe(dest("./"))
.on('end', () => log('Local files written'))
.pipe(dest(process.env.DEST))
.on('end', () => log(`.obsidian file written at ${process.env.DEST}`))
}
exports.build = processCSS;
exports.default = () => {
watch("./styles/**/*.css", {ignoreInitial: false}, processCSS);
}