forked from GetPublii/Publii
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
45 lines (40 loc) · 1.05 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"use strict";
/*
* Necessary plugins
*/
const gulp = require('gulp');
const sass = require('gulp-dart-sass');
const exec = require('child_process').exec;
const fs = require('fs');
/*
* Paths configuration
*/
const paths = {
"frontend-js": 'app/js/front-end/',
"backend-js": 'app/back-end/',
"sass": 'app/src/scss/editor/',
"css": 'app/dist/css/',
"base": 'app/'
};
/*
* Parse SASS into CSS
*/
gulp.task('prepare-editor-css', gulp.series(
() => gulp.src(paths.sass + 'editor.scss')
.pipe(sass())
.pipe(gulp.dest(paths['css'])),
() => gulp.src(paths.sass + 'editor-options.scss')
.pipe(sass())
.pipe(gulp.dest(paths['css']))
));
/*
* Build
*/
function updateBuildNumber (cb) {
let buildData = JSON.parse(fs.readFileSync('app/back-end/builddata.json'));
buildData.build += 1;
buildData = JSON.stringify(buildData);
fs.writeFileSync('app/back-end/builddata.json', buildData);
cb();
}
gulp.task('build', gulp.series(updateBuildNumber));