Skip to content

myrotvorets/ejs-compiled-loader

 
 

Repository files navigation

ejs-compiled-loader for webpack

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

This is the fork of the now abandoned bazilio91/ejs-compiled-loader with updated dependencies, fixed vulnerabilities, and updated code base.

The main differences are:

  • uses [email protected] instead of 2.x because ejs up to 3.1.9 has multiple vulnerabilities (CVE-2022-29078, CVE-2024-33883);
  • uses html-minifier-terser instead of the abandoned html-minifier (which is affected by a ReDoS vulnerability). Some options of html-minifier-terser differs from those of html-minifier;
  • does not suppoprt Webpack 4.x.

Installation

npm install -D @myrotvorets/ejs-compiled-loader

Usage

Documentation: Using loaders

const template = require("ejs-compiled-loader!./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

Options

The following options are supported:

License

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

About

EJS loader for webpack (without frontend dependencies)

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • JavaScript 96.1%
  • EJS 3.9%