-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathgulpfile.js
52 lines (44 loc) · 1.24 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
46
47
48
49
50
51
52
const gulp = require('gulp');
const jade = require('gulp-pug');
const preprocess = require('gulp-preprocess');
const stylus = require('gulp-stylus');
const concat = require('gulp-concat');
var pathDest = 'build/';
var pathSrc = 'src/';
var userJs = 'send_with_style.user.js';
var metaJs = 'send_with_style.meta.js';
exports.jade = function _jade() {
return gulp.src(pathSrc + 'container.jade')
.pipe(jade())
.pipe(gulp.dest(pathDest));
};
exports.stylus = function _stylus() {
return gulp.src(pathSrc + 'style.styl')
.pipe(stylus({ compress: true }))
.pipe(gulp.dest(pathDest));
};
function _js() {
return gulp.src(pathSrc + userJs)
.pipe(preprocess())
.pipe(gulp.dest(pathDest));
}
exports.js = gulp.series(gulp.parallel(exports.jade, exports.stylus), _js);
exports.meta = function _meta() {
return gulp.src(pathSrc + metaJs)
.pipe(gulp.dest(pathDest));
};
exports.concat = function _concat() {
return gulp.src([pathSrc + metaJs, pathDest + userJs])
.pipe(concat(userJs))
.pipe(gulp.dest(pathDest));
};
exports.watch = function watch() {
gulp.watch(pathSrc + '*.*', ['build']);
};
exports.default = exports.build = gulp.series(
exports.jade,
exports.stylus,
exports.meta,
exports.js,
exports.concat
);