micro-tpl-loader
v0.1.0
Published
Micro mustache template loader for webpack
Downloads
123
Maintainers
Readme
micro-tpl-loader
Micro mustache template loader for webpack.
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>