-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.esm.js
66 lines (59 loc) · 1.22 KB
/
gulpfile.esm.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
import * as task from '@colinrotherham/core';
import config from './tasks/config.json';
import gulp from 'gulp';
import webpackConfig from './webpack.config.mjs';
// Add webpack config
config.js.webpack = { ...config.js.webpack, options: webpackConfig };
/**
* Child tasks
*/
gulp.task('clean', task.clean(config.clean));
gulp.task('copy', task.copy(config.copy, gulp));
gulp.task('css', task.css(config.css, gulp));
gulp.task('html:nunjucks', task.html.nunjucks(config.html.nunjucks, gulp));
gulp.task('img:optimise', task.img.optimise(config.img.optimise, gulp));
gulp.task('js:webpack', task.js.webpack(config.js.webpack, gulp));
gulp.task('serve', task.serve(config.serve));
gulp.task('watch', task.watch(config, gulp));
/**
* Main tasks
*/
// Shared code compile task
gulp.task(
'compile',
gulp.series(
'js:webpack',
'css',
),
);
// Shared build tasks
gulp.task(
'build',
gulp.series(
'compile',
gulp.parallel(
'html:nunjucks',
'img:optimise',
),
),
);
// Default tasks
gulp.task(
'default',
gulp.series(
'clean',
'copy',
'build',
),
);
// Development tasks
gulp.task(
'dev',
gulp.series(
'default',
gulp.parallel(
'watch',
'serve',
),
),
);