var gulp = require('gulp'),
uglify = require('gulp-uglify');
gulp.task('scripts', function() {
gulp.src('js/*.js')
.pipe(uglify())
.pipe(gulp.dest('build/js'));
});
// Styles Task
// Uglifies
gulp.task('styles', function() {
console.log('Runs Style');
});
// Watch files
gulp.task('watch', function() {
gulp.watch('js/*.js', ['scripts'])
});
gulp.task('default', ['scripts','styles']);
assert.js:81抛出新的assert.AssertionError({^ AssertionError: 必须指定任务功能 在Gulp.set [as _setTask](D:\ mohamed \ CS \ Third year \ Seconed Term \ Web 编程\ W-P \项目\ node_modules \承办\ LIB \设置task.js:10:3) 在Gulp.task(D:\ mohamed \ CS \ Third year \ Seconed Term \ Web Programming \ W-P \ project \ node_modules \ undertaker \ lib \ task.js:13:8) 在对象。 (D:\ mohamed \ CS \ Third year \ Seconed Term \ Web Programming \ W-P \ project \ js \ gulpfile.js:22:6) 在Module._compile(module.js:570:32) 在Object.Module._extensions..js(module.js:579:10) 在Module.load(module.js:487:32) 在tryModuleLoad(module.js:446:12) 在Function.Module._load(module.js:438:3) 在Module.require(module.js:497:17) at require(internal / module.js:20:19)