my-ejs-loader

1.0.0 • Public • Published

simple ejs loader

example

  1. webpack config
module.exports = {
  module: {
    rules: [
      {
        test: /\.ejs$/,
        loader: "my-ejs-loader",
        options: {
          client: true,
          _with: false,
          ...ejs options,
        }
      }
    ]
  }
};
  1. button.ejs
<el-button type="<%= locals.type %>" size="<%= locals.size %>"><%= locals.text %></el-button>
  1. test.js
import button from "./button.ejs";
const result = button({ text: "test", size: "small" });
console.log(result);
// <el-button type="" size="small">test</el-button>

Readme

Keywords

none

Package Sidebar

Install

npm i my-ejs-loader

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

1.44 kB

Total Files

3

Last publish

Collaborators

  • x373241884y