-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
50 lines (45 loc) · 1.34 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
const gulp = require('gulp');
const plumber = require('gulp-plumber');
const { SOURCE_DIR, DIST_DIR, WORKING_DIR, CONFIGURATION_FILE } = require('./constants');
const options = {
sourceDir: SOURCE_DIR,
distDir: DIST_DIR,
workingDir: WORKING_DIR,
configurationFile: CONFIGURATION_FILE,
src: function plumbedSrc() {
return gulp.src.apply(gulp, arguments).pipe(plumber());
}
};
/**
* Load tasks from the '/tasks' directory.
*/
require('./tasks/build')(options);
require('./tasks/dupe')(options);
require('./tasks/less')(options);
require('./tasks/lint')(options);
require('./tasks/postcss')(options);
require('./tasks/sass')(options);
require('./tasks/check-for-unused').checkForUnusedTask(options);
/* Runs the entire pipeline once. */
gulp.task(
'run-pipeline',
gulp.series('dupe', 'less', 'sass', 'postcss', 'lint', 'build', gulp.parallel('check-for-unused'))
);
/* By default templates will be built into '/dist'. */
gulp.task(
'default',
gulp.series('run-pipeline', () => {
/* gulp will watch for changes in '/templates'. */
gulp.watch(
[
options.sourceDir + '/**/*.html',
options.sourceDir + '/**/*.css',
options.sourceDir + '/**/*.scss',
options.sourceDir + '/**/*.less',
options.sourceDir + '/**/conf.json'
],
{ delay: 500 },
gulp.series('run-pipeline')
);
})
);