steelsojka / ejs-transform-loader

A webpack loader for compiling ejs style files at build time.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ejs-transform-loader

A webpack loader for compiling ejs style files at build time.

npm install ejs-transform-loader
// webpack.config.js
module.exports = {
  module: {
    rules: [
      {
        test: /\.ejs$/,
        loader: `ejs-transform-loader`,
        options: {
          data: { testFiles: process.env.TEST_FILES }
        }
      },
    ],
  },
}
// some-file.ejs
const testFiles = [ <%= testFiles %> ];

About

A webpack loader for compiling ejs style files at build time.

License:MIT License


Languages

Language:JavaScript 100.0%