micro-tpl-loader

0.1.0 • Public • Published

micro-tpl-loader

Micro mustache template loader for webpack.

npm github node

Support MicroMustache interpolation. Not for Handlebars and Mustache.

Installation

npm install micro-tpl-loader --save-dev

Usage

// example: webpack.config.cjs

const params = {
  // define params here
  foo: 'bar',
  xyz: {
    abc: 123
  }
};

module.exports = {
  module: {
    rules: [
      {
        test: /\.tpl$/,
        use: {
          loader: 'micro-tpl-loader',
          options: {
            params
          }
        }
      }
    ]
  }
};
<!-- index.tpl -->
<div>{{ foo }}</div>
<div>{{ xyz.abc }} - test</div>

↓↓

<!-- index.html -->
<div>bar</div>
<div>123 - test</div>

Dependencies (1)

Dev Dependencies (6)

Package Sidebar

Install

npm i micro-tpl-loader

Weekly Downloads

5

Version

0.1.0

License

MIT

Unpacked Size

4.46 kB

Total Files

7

Last publish

Collaborators

  • airkro