如题: 不知道用哪个插件可以实现
热加载?
test.js function* idMaker(){ var index = 0; while(index<3){ yield index++; } } var gen = idMaker(); console.log(gen.next().value); console.log(gen.next().value); console.log(gen.next().value); console.log(gen.next().value);
当保存文件的时候,控制台能自动打印出来
目前的 gulpfile.js
var gulp = require(‘gulp’), cache = require(‘gulp-cached’), jshint = require(‘gulp-jshint’);
gulp.task(‘jshint’, function () { gulp.src(‘js/*/.js’) .pipe(cache(‘jshint’)) .pipe(jshint({esnext:true})) // Support for es6 .pipe(jshint.reporter(‘default’)); });
gulp.task(‘watch’, function () { gulp.watch(‘js/*/.js’, [‘jshint’]); }); gulp.task(‘default’, [‘jshint’, ‘watch’]);
@luckbb 问题添加了描述,请查阅