why am i getting this error? dest.on is not a func

2019-06-14 21:10发布

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条回答
Bombasti
2楼-- · 2019-06-14 21:24

This line:

.pipe(fileinclude)

Should be this:

.pipe(fileinclude())
查看更多
登录 后发表回答