-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
28 lines (23 loc) · 1016 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
23
24
25
26
27
28
process.env.NODE_CONFIG_DIR = './.config'
const config = require('config')
const gls = require('gulp-live-server')
const { series, watch, parallel } = require('gulp')
const { clean } = require('./.gulp/clean')
const { copy } = require('./.gulp/copy')
const { html } = require('./.gulp/html')
const { styles } = require('./.gulp/styles')
const { scripts } = require('./.gulp/scripts')
const WATCH_STYLES = config.get('watch.styles')
const WATCH_SCRIPTS = config.get('watch.scripts')
const WATCH_VIEWS = config.get('watch.views')
const WATCH_SNIPPETS = config.get('watch.snippets')
const watch_changes = () => {
var server = gls.static('public', 9999)
server.start()
watch(WATCH_STYLES, series(styles, copy))
watch(WATCH_SCRIPTS, series(scripts, copy))
watch(WATCH_VIEWS, series(html, copy))
watch(WATCH_SNIPPETS, series(html, copy))
}
exports.build = series(clean, parallel(styles, scripts), html, copy)
exports.serve = series(clean, parallel(styles, scripts), html, copy, watch_changes)