apoejs-webpack-loader

2.2.2 • Public • Published

apoejs-webpack-loader for webpack 4.x

Fork from ejs-webpack-loader (https://github.com/rorkflash/ejs-webpack-loader), Ashot Gasparyan rorkflash@gmail.com

apoejs-webpack-loader for webpack 4.x

Fork from ejs-webpack-loader (https://github.com/rorkflash/ejs-webpack-loader), Ashot Gasparyan rorkflash@gmail.com

Main difference is that there is an option to use qs.stringify to pass params

Examples

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

or

new HTMLWebpackPlugin({
            template: `html-loader!extract-loader!apoejs-webpack-loader?${qs.stringify(some)}!views/main.ejs`,
            filename: 'index.html',
            chunks: ['main'],
            inject: 'head',
            minify: {
                removeComments: true,
                collapseWhitespace: false,
            },
        }),

or

new HTMLWebpackPlugin({
            template: `html-loader!extract-loader!apoejs-webpack-loader?${JSON.stringify(some)}!views/main.ejs`,
            filename: 'index.html',
            chunks: ['main'],
            inject: 'head',
            minify: {
                removeComments: true,
                collapseWhitespace: false,
            },
        }),

JSON.stringify can produce '!' in some cases which is not valid for template "url", so qs could be used.

Package Sidebar

Install

npm i apoejs-webpack-loader

Weekly Downloads

1

Version

2.2.2

License

MIT

Unpacked Size

6.51 kB

Total Files

12

Last publish

Collaborators

  • apotap2