Skip to content
EJS loader for webpack
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
README.md
index.js
package.json

README.md

Usage

sudo npm install ejs2-loader --save

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

You can’t perform that action at this time.