why am i getting this error? dest.on is not a function - using gulp-file-include

人盡茶涼 提交于 2019-12-23 06:46:07

问题


I am getting an Error of TypeError: dest.on is not a function. When running this task, I can't figure out what could be wrong.

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('./'));
});

回答1:


This line:

.pipe(fileinclude)

Should be this:

.pipe(fileinclude())


来源:https://stackoverflow.com/questions/35675762/why-am-i-getting-this-error-dest-on-is-not-a-function-using-gulp-file-include

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!