0
我试图让现场的重载使用一饮而尽咕嘟咕嘟运行
但是运行之后,如下吞掉退出,我不能够打到服务器Express服务器工作后退出
CMD输出:
d:\ Users \用户工作空间\服务器>吞服务器 [11时31分56秒]使用gulpfile d:\ Users \用户工作空间\服务器\ gulpfile.js
[11时31分56秒]启动 '服务器' ...
[十一时31分56秒]后26毫秒
livereload [微小-LR]侦听35729 ...
d成品 '服务器':\ Users \用户工作空间\服务器>
gulpfile.js:
var gulp = require('gulp');
var server = require('gulp-express');
gulp.task('server', function() {
// Start the server at the beginning of the task
server.run(['app.js']);
// Restart the server when file changes
gulp.watch(['app/**/*.html'], server.notify);
gulp.watch(['app/styles/**/*.scss'], ['styles:scss']);
//gulp.watch(['{.tmp,app}/styles/**/*.css'], ['styles:css', server.notify]);
//Event object won't pass down to gulp.watch's callback if there's more than one of them.
//So the correct way to use server.notify is as following:
gulp.watch(['{.tmp,app}/styles/**/*.css'], function(event){
gulp.run('styles:css');
server.notify(event);
//pipe support is added for server.notify since v0.1.5,
//see https://github.com/gimm/gulp-express#servernotifyevent
});
gulp.watch(['app/scripts/**/*.js'], ['jshint']);
gulp.watch(['app/images/**/*'], server.notify);
gulp.watch(['app.js', 'routes/**/*.js'], [server.run]);
});
gulp.task('default', ['server']);
在我打电话的时候,有没有根本不正确的东西?
'gulp-express'已弃用,并且一直未维护一年。改用['gulp-live-server'](https://github.com/gimm/gulp-live-server)。 –
你是什么意思现场重新加载? – gh0st