84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
最近在研究gulp插件的用法,而且公司内部使用的也是gulp自动化构建,使用jade预编译语言进行html内容的构建。当项目规模越来越大,文件数量累计到一定程度后,每一次编译html都要花很久的时间,经常在执行编译html任务就要耗费20秒-30秒的时间,这很影响效率。想请问gulp-cache配合jade能否配合使用?
学习是最好的投资!
gulp-newer only builds changed files
It can be used, as long as it is a file, it can be cached.
The following is from my previous actual project, you can try it
var TYPE = 'DEV'; var VIEWS = ["src/views/**/*.jade"]; gulp.task("compile-views", function() { var config = (TYPE == 'DEV') ? { time: "" } : { time: "?v=" + new Date().getTime() }; config.type = TYPE; return gulp.src(VIEWS) .pipe(cached("debug", { optimizeMemory: true })) .pipe(jade({ locals: config })) .on("error", function(error) { console.dir(error); this.emit('end'); }) .pipe(gulp.dest(FOLDER + APP)); });
gulp-newer only builds changed files
It can be used, as long as it is a file, it can be cached.
The following is from my previous actual project, you can try it