-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
36 lines (32 loc) · 772 Bytes
/
gulpfile.js
File metadata and controls
36 lines (32 loc) · 772 Bytes
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
// https://gist.github.com/sogko/b53d33d4f3b40d3b4b2e
const gulp = require('gulp')
const browserSync = require('browser-sync').create()
const nodemon = require('gulp-nodemon')
gulp.task('default', ['browser-sync'], function () {
})
gulp.task('browser-sync', ['nodemon'], function() {
browserSync.init({
proxy: 'http://localhost:5000',
files: ['client/**/*.*'],
browser: 'google chrome',
port: 7000,
reloadDelay: 1000,
})
})
gulp.task('nodemon', function (cb) {
let started = false
return nodemon({
script: './server/bin/www',
ignore: [
'test/',
'client/public/',
'gulpfile.js',
'node_modules/'
],
}).on('start', function () {
if (!started) {
setTimeout(cb, 500)
started = true
}
})
})