Javascript 在jade中对更改的文件运行gulp
我在a/source文件夹中有一个jade原型,结构如下:Javascript 在jade中对更改的文件运行gulp,javascript,gulp,Javascript,Gulp,我在a/source文件夹中有一个jade原型,结构如下: /source/prototypes/my-prototype-1/index.jade /source/prototypes/my-prototype-2/index.jade 以下是吞咽任务: gulp.task('jade', function() { return gulp.src(['source/**/*.jade']) .pipe(changed('build/prototypes/', {extensi
/source/prototypes/my-prototype-1/index.jade
/source/prototypes/my-prototype-2/index.jade
以下是吞咽任务:
gulp.task('jade', function() {
return gulp.src(['source/**/*.jade'])
.pipe(changed('build/prototypes/', {extension: '.html'}))
.pipe(jade({
pretty: true
}))
.pipe(gulp.dest('build'))
.on('error', gutil.log)
.pipe(notify({ message: 'Jade task is complete' }));
});
原型被编译成:
/build/prototypes/my-prototype-1/index.jade
/build/prototypes/my-prototype-2/index.jade
问题是,当所有原型中的任何一个发生变化时,它们仍在被重新编译。这可能是因为我在文件夹中嵌套原型的方式吗?gulp changed文档说第一个参数是
目标目录。与放入gulp.dest()中的步骤相同
试着换一条线
.pipe(已更改('build/prototype/',{extension:'.html'}))
与
.pipe(已更改('build',{extension:'.html}))