Browse Source

修复server不会自动更新

master
blobt 4 years ago
parent
commit
e2be6fd2fd
  1. 18
      tasks/server.js

18
tasks/server.js

@ -4,16 +4,16 @@ import liveserver from 'gulp-live-server';
import args from './util/args';
gulp.task('server',(cb)=>{
if(!args.watch) return cb();
if(!args.watch) return cb();
var server = liveserver.new(['--harmony', 'server/bin/www']);
server.start();
var server = liveserver.new(['--harmony','server/bin/www']);
server.start();
gulp.watch(['server/public/**/*.js', 'server/public/**/*.ejs'], function(file){
server.notify.apply(server, [file])
})
gulp.watch(['server/public/**/*.js','server/views/**/*.ejs'],function(file){
server.notify.apply(server,[file]);
})
gulp.watch(['server/routes/**/*.js', 'server/app.js'], function(){
server.start.bind(server)()
})
gulp.watch(['server/routes/**/*.js','server/app.js'],function(){
server.start.bind(server)()
});
})
Loading…
Cancel
Save