我收到 TypeError 错误:dest.on 不是函数
。运行此任务时,我无法弄清楚可能出了什么问题。
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('./'));
});
最佳答案
这一行:
.pipe(fileinclude)
应该是这样的:
.pipe(fileinclude())
关于javascript - 为什么我会收到此错误? dest.on 不是一个函数 - 使用 gulp-file-include,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35675762/