-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
24 lines (21 loc) · 852 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
var gulp = require('gulp');
var nodemon = require('gulp-nodemon');
var browserSync = require('browser-sync').create();
gulp.task('gulp_nodemon', function () {
nodemon({
script: './server/server.js' //this is where my express server is
, ext: 'js html css' //nodemon watches *.js, *.html and *.css files
, env: { 'NODE_ENV': 'development' }
});
});
gulp.task('sync', function(){
browserSync.init({
port: 3002, //this can be any port, it will show our app
proxy: 'http://localhost:3000/', //this is the port where express server works
ui: {port: 3003}, //UI, can be any port
reloadDelay: 100 //Important, otherwise syncing will not work
});
gulp.watch(['./**/*.js', './**/*.html', './**/*.css']).on("change",
browserSync.reload);
});
gulp.task('default', ['gulp_nodemon', 'sync']);