forked from GoogleChrome/developer.chrome.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
22 lines (18 loc) · 883 Bytes
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const {parallel, watch} = require('gulp');
// Pull in each task
const sassTask = require('./gulp-tasks/sass.js');
const staticTask = require('./gulp-tasks/static.js');
const writeVersionTask = require('./gulp-tasks/write-version.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('./site/_scss/**/*.scss', {ignoreInitial: true}, sassTask);
watch('./site/_static/**/*', {ignoreInitial: true}, staticTask);
};
// The default (if someone just runs `gulp`) is to run each task in parrallel
exports.default = parallel(sassTask, staticTask, writeVersionTask);
// This is our watcher task that instructs gulp to watch directories and
// act accordingly
exports.watch = watcher;