-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.babel.js
executable file
·37 lines (33 loc) · 1.06 KB
/
Gulpfile.babel.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
import {watch, parallel, series} from 'gulp'
import {browsersync} from './tasks/browsersync'
import clean from './tasks/clean'
import stylesheets from './tasks/stylesheets'
import javascripts from './tasks/javascripts'
import html from './tasks/html'
import copy from './tasks/copy'
import icons from './tasks/icons'
// Build task
export const build = series(clean, icons, parallel(javascripts, html, stylesheets, copy))
// Development task
export const development = series(clean, icons, parallel(javascripts, stylesheets, html), function run() {
// Start browserSync
browsersync.init({
'server': {
'baseDir': ['src', 'dest'],
'routes': {
'/node_modules': 'node_modules'
},
middleware: function (req, res, next) {
res.setHeader('Access-Control-Allow-Origin', '*');
next();
}
}
})
// Watch files, run compliers
watch('src/stylesheets/**/*.scss', stylesheets)
watch('src/**/*.jade', html)
watch('src/javascripts/**/*.js', javascripts)
watch('src/icons/*.svg', icons)
// Watch for Changes
watch('**/*.html').on('change', browsersync.reload)
})