我收到错误TypeError: dest.on is not a function
。在运行此任务时,我无法弄清楚可能出现的问题。
var fileinclude = require('gulp-file-include');
var rename = require('gulp-rename');
var paths = {
templates : './templates/'
}
//file include: grab partials from templates and render out html files
gulp.task('fileinclude', function() {
return gulp.src(paths.templates + '*.tpl.html')
.pipe(fileinclude)
.pipe(rename({
extname: ""
}))
.pipe(rename({
extname: ".html"
}))
.pipe(gulp.dest('./'));
});
答案 0 :(得分:49)
这一行:
.pipe(fileinclude)
应该是这样的:
.pipe(fileinclude())