Micro mustache template loader for webpack.
Support MicroMustache interpolation. Not for Handlebars
and Mustache
.
npm install micro-tpl-loader --save-dev
// 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>