Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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('./')); }); 
like image 477
91eahz Avatar asked Feb 27 '16 21:02

91eahz


People also ask

Where is gulpfile js located?

Writing the First Gulp Task. All Gulp configuration goes in a file called gulpfile. js located at the root of the project. The pattern for writing tasks is that you first load a plugin you're about to use and then define a task that is based on that plugin.

What is gulp js file?

A gulpfile is a file in your project directory titled gulpfile. js (or capitalized as Gulpfile. js , like Makefile), that automatically loads when you run the gulp command.

What is gulp task runner?

Gulp is a task runner that uses Node. js as a platform. It purely uses the JavaScript code and helps to run front-end tasks and large-scale web applications. Gulp builds system automated tasks like CSS and HTML minification, concatenating library files, and compiling the SASS files.


1 Answers

This line:

.pipe(fileinclude) 

Should be this:

.pipe(fileinclude()) 
like image 66
Sven Schoenung Avatar answered Sep 23 '22 19:09

Sven Schoenung