This repository has been archived by the owner on Apr 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
/
gulpfile.js
88 lines (72 loc) · 2.18 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
77
78
79
80
81
82
83
84
85
86
87
88
/*
* * * * * ==============================
* * * * * ==============================
* * * * * ==============================
* * * * * ==============================
========================================
========================================
========================================
----------------------------------------
Based on @uswds/compile
----------------------------------------
*/
const gulp = require("gulp");
const uswds = require("@uswds/compile");
uswds.settings.version = 3;
/*
----------------------------------------
PATHS
----------------------------------------
- All paths are relative to the
project root
- Don't use a trailing `/` for path
names
----------------------------------------
*/
// Project Sass source directory
const PROJECT_USWDS_SASS_SRC = "./assets/stylesheets/lib/uswds-sass";
// Project Sass theme directory
uswds.paths.dist.theme = "./assets/stylesheets/site";
// Images destination
uswds.paths.dist.img = "./assets/img/lib/uswds";
// Fonts destination
uswds.paths.dist.fonts = "./assets/fonts/lib/uswds";
// Javascript destination
uswds.paths.dist.js = "./assets/js/lib/uswds";
// Compiled CSS destination
uswds.paths.dist.css = "./assets/stylesheets/css";
/*
----------------------------------------
TASKS
----------------------------------------
*/
exports.copyUSWDSTheme = uswds.copyTheme;
exports.copyUSWDSCore = () => {
return gulp
.src(`./node_modules/uswds/dist/scss/core/**/**`)
.pipe(gulp.dest(`${PROJECT_USWDS_SASS_SRC}/core`));
};
exports.copyUSWDSLib = () => {
return gulp
.src(`./node_modules/uswds/dist/scss/core/**/**`)
.pipe(gulp.dest(`${PROJECT_USWDS_SASS_SRC}/lib`));
};
exports.copyUSWDSSettings = () => {
return gulp
.src(`./node_modules/uswds/dist/scss/settings/**/**`)
.pipe(gulp.dest(`${PROJECT_USWDS_SASS_SRC}/settings`));
};
exports.copyFonts = uswds.copyFonts;
exports.copyImages = uswds.copyImages;
exports.copyJS = uswds.copyJS;
exports.copyAssets = uswds.copyAssets;
exports.compileSass = uswds.compileSass;
exports.watch = uswds.watch;
exports.default = uswds.watch;
exports.init = gulp.series(
this.copyUSWDSTheme,
this.copyUSWDSCore,
this.copyUSWDSLib,
uswds.copyAll,
uswds.compileSass
);