我的 gulpfile 中有以下代码
gulp.task('scripts', function () {
gulp.src(paths.browserify)
.pipe(browserify())
.pipe(gulp.dest('./build/js'))
.pipe(refresh(server));
});
gulp.task('lint', function () {
gulp.src(paths.js)
.pipe(jshint())
.pipe(jshint.reporter(stylish));
});
gulp.task('nodemon', function () {
nodemon({
script: 'app.js'
});
});
我需要在 Nodemon 重新启动时运行脚本和 lint 任务。我有以下内容
gulp.task('nodemon', function () {
nodemon({
script: 'app.js'
}).on('restart', function () {
gulp.run(['scripts', 'lint']);
});
});
Gulp.run() 现在已弃用,那么我将如何使用 gulp 和最佳实践来实现上述目标?