-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgulpfile.js
27 lines (22 loc) · 1.08 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
const { parallel, watch } = require("gulp");
// Pull in each task
const fonts = require("./gulp-tasks/fonts.js");
const images = require("./gulp-tasks/images.js");
const sass = require("./gulp-tasks/sass.js");
const jscompress = require("./gulp-tasks/jsmin.js");
const svgicons = require("./gulp-tasks/svg-store.js");
// Set each directory and contents that we want to watch and
// assign the relevant task. `ignoreInitial` set to true will
// prevent the task being run when we run `gulp watch`, but it
// will run when a file changes.
const watcher = () => {
watch("./src/scss/**/*.scss", { ignoreInitial: true }, sass);
watch("./src/images/**/*", { ignoreInitial: true }, images);
watch("./src/scripts/**/*.js", { ignoreInitial: true }, jscompress);
watch("./src/icons/**/*.svg", { ignoreInitial: true }, svgicons);
};
// The default (if someone just runs `gulp`) is to run each task in parrallel
exports.default = parallel(fonts, svgicons, images, jscompress, sass);
// This is our watcher task that instructs gulp to watch directories and
// act accordingly
exports.watch = watcher;