Skip to content

Repository files navigation

compile-ejs-loader for webpack

webpack loader use to compile ejs templates.

Installation

npm install compile-ejs-loader

Usage

Documentation: Using loaders

vartemplate=require("compile-ejs-loader!./file.ejs");// => returns the template function compiled with ejs templating engine.// And then use it somewhere in your codetemplate(data)// Pass object with data// Child Templates// path is relative to where webpack is being run<%-includetemplates/child-%>

Options

besides ejs compile options, you can add these addtion options:

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

compileDebug — see ejs compileDebug option

htmlmin — see htmlminify section

htmlminOptions - See all htmlminify options reference

webpack config example

module: {rules: [{test: /\.ejs$/,loader: 'compile-ejs-loader',options: {'htmlmin': true,'htmlminOptions': {removeComments: true}}}]}

License

MIT (http://www.opensource.org/licenses/mit-license.php)

About

webpack loader use to compile ejs templates (without frontend dependencies)

Resources

Stars

11 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages