Browse Source

修复server不会自动更新

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

10
tasks/server.js

@ -6,14 +6,14 @@ import args from './util/args';
gulp.task('server',(cb)=>{
if(!args.watch) return cb();
var server = liveserver.new(['--harmony', 'server/bin/www']);
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(){
gulp.watch(['server/routes/**/*.js','server/app.js'],function(){
server.start.bind(server)()
})
});
})
Loading…
Cancel
Save