forked from mozilla/testpilot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.babel.js
75 lines (64 loc) · 1.6 KB
/
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/* eslint-disable import/no-extraneous-dependencies*/
require('babel-polyfill');
const gulp = require('gulp');
const config = require('./frontend/config.js');
const del = require('del');
const eslint = require('gulp-eslint');
const runSequence = require('run-sequence');
require('es6-promise').polyfill();
require('isomorphic-fetch');
require('./frontend/tasks/content');
require('./frontend/tasks/scripts');
require('./frontend/tasks/styles');
require('./frontend/tasks/images');
require('./frontend/tasks/assets');
require('./frontend/tasks/pages');
require('./frontend/tasks/server');
require('./frontend/tasks/dist');
gulp.task('clean', () => del([
config.DEST_PATH,
config.DIST_PATH
]));
gulp.task('distclean', () => del([
config.DEST_PATH,
config.DIST_PATH,
'./node_modules',
'./addon/node_modules'
]));
gulp.task('build', done => runSequence(
'content-build',
'scripts-build',
'styles-build',
'images-build',
'assets-build',
'pages-build',
done
));
gulp.task('watch', [
'self-watch',
'content-watch',
'scripts-watch',
'styles-watch',
'images-watch',
'assets-watch',
'pages-watch'
]);
gulp.task('default', done => runSequence(
'self-lint',
'clean',
'build',
'watch',
'server',
done
));
// Exit if the gulpfile changes so we can self-reload with a wrapper script.
gulp.task('self-watch', () => gulp.watch([
'./gulpfile.babel.js',
'./frontend/config.js',
'./debug-config.json',
'./frontend/tasks/*.js'
], () => process.exit()));
gulp.task('self-lint', () => gulp.src('gulpfile.babel.js')
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failOnError()));