lodash-template-source-loader
v1.0.0
Published
Compile a lodash template and load its source. I can't believe this didn't already exist.
Downloads
3
Maintainers
Readme
lodash-template-source-loader
Compile a lodash template and load its source. I can't believe this didn't already exist.
Usage
webpack.config.js:
module.exports = {
module: {
// ...
rules: [
// ...
{
test: /\.html$/,
use: 'lodash-template-loader',
}
],
},
};
index.js:
import template from './index.html';
// <div>bar</div>
template({ foo: 'bar' });
index.html:
<div><%- obj.foo -%></div>