ejs-prerender-loader

1.0.6 • Public • Published

ejs-prerender-loader

Basis

Warning: This loader requires Webpack 5!

This webpack plugin is based on the ejs-prerender package. See that for more information on configuration options and goals. This Webpack loader was specifically created for use by ejs-prerender-webpack-plugin.

Usage

While most other EJS Webpack loaders are for client implementations, the goal of this loader is for pre-rendering. This means it acts like a template engine for a web server, allowing full usage of <%- include('my-partial', { data: 'my data' }) -%> for passing data to dynamic partials. While it is designed for use by the aforementioned Webpack plugin, it can be used separately by including it in your Webpack config's module rules.

module.exports = {
  module: {
    rules: [
      {
        test: /\.ejs$/,
        use: [{
          loader: 'ejs-prerender-loader',
        }],
      },
    ]
  }
};

For a full example of the plugin being used, look at the ejs-starter repository.

Versions

Current Tags

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

Version History

Package Sidebar

Install

npm i ejs-prerender-loader

Weekly Downloads

1

Version

1.0.6

License

MIT

Unpacked Size

4.1 kB

Total Files

4

Last publish

Collaborators

  • wilderbeest