Skip to content
EJS loader for webpack (without frontend dependencies)
JavaScript HTML
Branch: 2.x
Clone or download
Carlos Guimaraes
Carlos Guimaraes Merge pull request #30 from yardnsm/2.x
Use loader options if available for webpack 2
Latest commit 6fea14b Aug 31, 2017
Type Name Latest commit message Commit time
Failed to load latest commit information.
test Fix tests Oct 13, 2016
.editorconfig htmlminify, fixes #9 Feb 1, 2016
.gitignore Loader in conjunction with ejs2. Test works as it should. May 12, 2015
LICENSE first commit Oct 24, 2014 Fix typo in documentation. "beautify" and "template" now spelled corr… Mar 5, 2016
index.js Use loader options if available Aug 8, 2017
package.json 2.2.0 Oct 14, 2016

ejs-compiled-loader for webpack

EJS loader for webpack. Uses ejs function to compile templates.

To use EJS by tj use 1.x branch and 1.x.x versions.


npm install ejs-compiled-loader


Documentation: Using loaders

var template = require("ejs-compiled!./file.ejs");
// => returns the template function compiled with ejs templating engine.

// And then use it somewhere in your code
template(data) // Pass object with data

// Child Templates
// path is relative to where webpack is being run
<%- include templates/child -%>


Following options can be specified in query:

beautify — enable or disable uglify-js beautify of template ast

compileDebug — see ejs compileDebug option

htmlmin — see htmlminify section


module: {
  loaders: [
    {test: /\.ejs$/, loader: 'ejs-compiled?htmlmin'} // enable here
'ejs-compiled-loader': {
  'htmlmin': true, // or enable here  
  'htmlminOptions': {
    removeComments: true

See all options reference



You can’t perform that action at this time.