ejs2-loader

1.0.0 • Public • Published

Usage

Documentation: Using loaders

in js

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) 
 

in webpack

module: {
    loaders: [
      {test: /\.ejs$/, loader: 'ejs2-loader?htmlmin=removeComments|removeAttributeQuotes|minifyCSS'}
    ]
}

HTMLMinifier, Options Quick Reference

Child Templates

<!-- Child Templates -->
<!-- path is relative to where webpack is being run -->
<!-- global variable -->
<%- var title = "This is really amazing" -%>
<%- include templates/header -%>

reference

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    1

Package Sidebar

Install

npm i ejs2-loader

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • wcjiang