-
Notifications
You must be signed in to change notification settings - Fork 21
/
gulpfile.js
73 lines (63 loc) · 1.78 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
const { series, parallel } = require('gulp');
const nodemon = require('nodemon');
require('./tasks/gulp/clean');
require('./tasks/gulp/compile-js');
require('./tasks/gulp/compile-scss');
require('./tasks/gulp/watch');
require('./tasks/gulp/copy-to-destination');
require('./tasks/gulp/asset-version');
require('./tasks/gulp/backstop');
require('./tasks/gulp/package');
require('./tasks/gulp/dist');
const { publishLocalWebjar, buildWebjar } = require('./tasks/gulp/webjar');
const copyDistFiles = series(
'copy-hmrc-images',
'copy-govuk-images',
'copy-govuk-fonts',
'copy-govuk-manifest-json',
);
const copyPackageFiles = series(
'copy-package-sources',
'copy-govuk-fonts',
'copy-govuk-images',
'copy-govuk-config',
'copy-govuk-manifest-json',
);
const buildPackage = series(
'clean',
copyPackageFiles,
'scss:compile-all-govuk-and-hmrc',
'scss:compile-accessible-autocomplete',
'js:compile-hmrc',
'js:compile-all-govuk-and-hmrc',
'js:compile-accessible-autocomplete',
'update-assets-version',
'copy:README',
'copy:LICENSE',
'copy:packageJson',
);
const buildDist = series(
'clean',
copyDistFiles,
'scss:compile-all-govuk-and-hmrc',
'scss:compile-accessible-autocomplete',
'js:compile-all-govuk-and-hmrc',
'js:compile-accessible-autocomplete',
'update-assets-version',
);
const backstopTest = series(buildDist, 'backstop-test');
const startNodemon = () => nodemon({
script: 'app/start',
});
const dev = series(buildDist, parallel(startNodemon, 'watch'));
// FIXME: fix named tasks above to export rather than using gulp.task, to avoid globally registering
// tasks unnecessarily
// See: https://gulpjs.com/docs/en/getting-started/creating-tasks
module.exports = {
buildPackage,
buildDist,
backstopTest,
dev,
buildWebjar,
publishLocalWebjar,
};