【发布时间】:2015-06-29 10:28:34
【问题描述】:
我有任务将jade编译成html
gulp.task('jade', function() {
var j = jade({});
j.on('error', function(e){
gutil.log(e);
j.end();
});
return gulp.src([
'src/templates/**/*.jade',
'!src/templates/mixins/**/*.jade',
'!src/templates/index.jade'
])
.pipe(j)
.pipe(gulp.dest(outputDir+'/templates'))
.pipe(connect.reload());
});
每次更改+保存后编译时间为 3 秒。我该如何改进这个过程?
附:我使用 gulp-jade 插件。
【问题讨论】:
-
SSD,更强大的硬件?
-
@vitr,不是解决方案 =/ 我有带 ssd 和电源的 macbook pro
-
你确定是编译需要时间吗?使用
console.time粗略测量瓶颈 -
是的,console.time,也试着去掉connect.reload,看看用纯编译任务能快多少。
-
@laggingreflex - 是的,我确定。从任务中删除 connect.reload()。什么都没有发生:/
标签: javascript node.js pug gulp