forked from uswds/uswds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
76 lines (66 loc) · 1.95 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
74
75
76
// Include gulp helpers.
const { series, parallel } = require("gulp");
// Include Our tasks.
//
// Each task is broken apart to it's own node module.
// Check out the ./tasks directory for more.
const { noCleanup, noTest } = require("./tasks/flags");
const { buildSprite, buildSpriteStandalone } = require("./tasks/svg-sprite");
const { compileJS, typeCheck } = require("./tasks/javascript");
const { unitTests, sassTests } = require("./tasks/test");
const { lintSass, typecheck } = require("./tasks/lint");
const { build } = require("./tasks/build");
const { release } = require("./tasks/release");
const { watch } = require("./tasks/watch");
const { compileSass } = require("./tasks/sass");
const { cleanDist } = require("./tasks/clean");
/**
* *Flags*
*/
exports.noTest = noTest;
exports.noCleanup = noCleanup;
/**
* *Clean tasks*
*/
exports.cleanDist = cleanDist;
/**
* *Lint tasks*
*/
exports.lintSass = lintSass;
exports.typecheck = typecheck;
exports.lint = parallel(lintSass, typecheck);
/**
* *Test tasks*
* sassTests: Sass unit tests.
* unitTests: Component unit tests.
* test: Run all tests.
*/
exports.sassTests = sassTests;
exports.unitTests = unitTests;
exports.test = series(
typeCheck,
lintSass,
sassTests,
unitTests,
);
/**
* *Build tasks*
* buildSprite: Generate new spritesheet based on SVGs in `src/img/usa-icons/`.
* buildSass: Lint, copy normalize, and compile sass.
* buildJS: Lint, copy normalize, and compile sass.
* release: Builds USWDS and returns a zip with sha256 hash and filesize.
*/
exports.buildSpriteStandalone = buildSpriteStandalone;
exports.buildSprite = buildSprite;
exports.buildSass = series(lintSass, compileSass);
exports.buildJS = series(typeCheck, compileJS);
exports.buildUSWDS = build;
exports.release = release;
/**
* *Watch task*
* Builds USWDS and component library, and watches
* for changes in scss, js, twig, yml, and unit tests.
*/
exports.watch = watch;
// Default Task
exports.default = this.buildUSWDS;