1.1.4 • Published 3 years ago

ivy-template-loader v1.1.4

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

ivy-template-loader

webpack template loader

模板预处理使用的是 lodash.template 机制

Installation

npm install ivy-template-loader

Usage

var template = require("index.tpl");
// => returns the template function compiled with template engine,like underscore (lodash).

// And then use it somewhere in your code
template(data) // Pass object with data

Config example using the ivy-template-loader config block.

module.exports = {
  rules: [
      {
        test: /\.tpl$/,
        exclude: /node_modules/,
        use: {
            loader: 'ivy-template-loader',
            options: {
                minimize: true,
                /* 可自定义 */
                settings: {
                    evaluate: /{{([\s\S]+?)}}/g,
                    interpolate: /<%=([\s\S]+?)%>/g,
                    escape: /<%-([\s\S]+?)%>/g
                }
            }
        }
      }
  ]
};
1.1.4

3 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago