forked from GSA/digitalgov.gov
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
32 lines (26 loc) · 1.21 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
var gulp = require("gulp");
require('./config/gulp/scripts');
require('./config/gulp/uswds');
const node_env = process.env.NODE_ENV ? process.env.NODE_ENV : 'development';
console.log("env: " + node_env);
if (process.env.NODE_ENV !== 'production') {
require('./config/gulp/img-prep');
require('./config/gulp/img-process');
require('./config/gulp/img-upload');
// Image Process tasks
gulp.task("img-prep", gulp.series('mkdir'));
gulp.task("img-process", gulp.series(gulp.parallel('img-variants', 'img-proxy')));
gulp.task("img-upload", gulp.series('cleanup'));
gulp.task("img", gulp.series('img-upload'));
}
// Watch Tasks
gulp.task('watch', function () {
gulp.watch('./themes/digital.gov/src/scss/uswds/**/*.scss', gulp.series('build-sass'));
gulp.watch('./themes/digital.gov/src/scss/new/**/*.scss', gulp.series('build-sass'));
gulp.watch('./themes/digital.gov/src/js/**/*.js', gulp.series('compile', 'compile-common'));
gulp.watch('./content/images/_inbox/*.*', gulp.series('img'));
});
// gulp build-assets — build without watching
gulp.task('build-assets', gulp.series('build-sass', 'compile', 'compile-common'));
// gulp — build + watch
gulp.task('default', gulp.series('build-assets','watch'));