gulp-ejs
ejs plugin for gulp
Usage
First, install gulp-ejs
as a development dependency:
npm install --save-dev gulp-ejs
Then, add it to your gulpfile.js
:
var ejs = require("gulp-ejs");
gulp.src("./templates/*.ejs")
.pipe(ejs({
msg: "Hello Gulp!"
}))
.pipe(gulp.dest("./dist"));
API
ejs(options, settings)
options
Type: hash
Default: {}
A hash object where each key corresponds to a variable in your template. Also you can set ejs options in this hash.
For more info on ejs
options, check the project's documentation.
settings
Type: hash
Default: {ext: '.html'}
A hash object to configure the plugin.
settings.ext
Type: String
Default: .html
Defines the default file extension that will be appended to the filename.
License
MIT License