sudo npm install ejs2-loader --save
var template = require("ejs-compiled!./file.ejs");
// => returns the template function compiled with ejs templating engine.
// And then use it somewhere in your code
// Pass object with data
template(data)
{
module: {
loaders: [
{test: /\.ejs$/, loader: 'ejs2-loader?htmlmin=removeComments|removeAttributeQuotes|minifyCSS'}
]
}
}
HTMLMinifier, Options Quick Reference
<!-- Child Templates -->
<!-- path is relative to where webpack is being run -->
<!-- global variable -->
<%- var title = "This is really amazing" -%>
<%- include templates/header -%>