ejs-webpack-builder

2.0.1 • Public • Published

EJS Webpack Builder

A Webpack Plugin to build EJS files directly.

Install

npm install ejs-webpack-builder --save-dev

Configuration

Define in your webpack configuration file the plugins with an array of file you want to compile

// webpack.config.js

var options = {
  files: ['.src/index.ejs','.src/admin.ejs']
};

module.exports = {
  plugins: [
    new ejsBuilder(options)
  ]
};

Options

You can configure your compilation with additional parameters:

{
  root: __dirname,
  files: [{
    source: {
      name: 'index.ejs',
      dir: './src',
    },
    target: {
      name: 'index.html',
      dir: 'views/'
    },
    parameters: {
      title: 'my site title',
      randomValue: 0
    },
    encoding: 'utf8'
  }]
}

EJS support

Go to the Latest Release

License

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

Package Sidebar

Install

npm i ejs-webpack-builder

Weekly Downloads

23

Version

2.0.1

License

MIT

Last publish

Collaborators

  • jonathan.argentiero