-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.babel.js
51 lines (45 loc) · 1002 Bytes
/
gulpfile.babel.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
'use strict';
import path from 'path';
import gulp from 'gulp';
import glob from 'glob';
import { KarmaServer, args } from './gulp/utils';
// This will grab all js in the `gulp` directory
// in order to load all gulp tasks
glob.sync('./gulp/tasks/**/*.js').filter(function(file) {
return (/\.(js)$/i).test(file);
}).map(function(file) {
require(file);
});
// Build production-ready code
gulp.task('build', gulp.series(
gulp.parallel(
'copy',
'imagemin',
'pug',
'sass',
'browserify'
),
'rev'
));
// Server tasks with watch
gulp.task('serve', gulp.series(
gulp.parallel(
'imagemin',
'copy',
'pug',
'sass',
'browserify',
'browserSync',
'watch'
)
));
// Default task
gulp.task('default', gulp.series('clean', 'build'));
// Testing
gulp.task('test', gulp.series('eslint', (done) => {
new KarmaServer({
configFile: path.join(__dirname, '/karma.conf.js'),
singleRun: !args.watch,
autoWatch: args.watch
}, done).start();
}));