Additionnaly到我的上述评论,我到这里报到:
需要注意的是,如果你的任务已经编译JS成精缩JS,你宁愿用2页型动物的文件夹。例如,一个文件夹/ source/js /其文件在min.js中编译到/ dist/js /(或/ public/js /或任何您想要的内容)中。
这一段代码,我经常用在我的大多数项目来连接和丑化我的.js文件:
// My task called jsmin depend on another task, assume it is called clean but could be whatever
// That means that until the clean task is not completed, the jsmin task will not be executed.
gulp.task('jsmin', ['clean'], function() {
// First I clean the destination folder
del([ 'public/js/*' ]);
// Then I compile all the Js contained in source/js/ into min.js into public/js/
// In my example I concatenate all the Js together then I minimize them.
return gulp.src('source/js/*.js')
.pipe(concat("js.min.js"))
.pipe(uglify())
.pipe(gulp.dest('public/js/'));
});
希望帮助你。
来源
2015-09-26 08:16:51
CDF
[从Gulp任务中排除文件/目录]可能的副本(http://stackoverflow.com/questions/23384239/excluding-files-directories-from-gulp-task) – afsantos