0.0.6 • Published 10 months ago
html-template-module-loader v0.0.6
html-template-module-loader
Getting Started
To begin, you'll need to install html-template-module-loader
:
$ npm install html-template-module-loader --save-dev
webpack.config.js
module.exports = {
module: {
rules: [
{
test: /\.html$/i,
use: [
{
loader: 'html-template-module-loader',
options: {
tag: 'tpl',
attr: 'file',
tplTag: 'template',
tplAttr: 'tpl'
}
},
],
},
],
},
};
example
// template: example-tpl.html
<template tpl>
模版
</template>
// html
<tpl file="./src/tpl/example-tpl.html"></tpl>