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('./')); });
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.
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.
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.
This line:
.pipe(fileinclude)
Should be this:
.pipe(fileinclude())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With