小编91e*_*ahz的帖子

为什么我会收到此错误?dest.on不是一个函数 - 使用gulp-file-include

我得到一个错误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('./'));
});
Run Code Online (Sandbox Code Playgroud)

javascript node.js gulp

33
推荐指数
1
解决办法
3万
查看次数

标签 统计

gulp ×1

javascript ×1

node.js ×1