A webpack loader to pre-build juicer.
npm install juicer-loader --save-dev
<div>
My name is $${name}
{@each list as item,k}
<div>${item.name},${k}</div>
{@/each}
</div>
var tpl = require('./hello.juicer.html');
console.log(tpl({
name: '<div>伯方</div>',
list:[
{name:1},
{name:'bf'}
]
}));
module.exports = {
entry: './src/index.js',
output: {
filename: 'build/bundle.js'
},
module: {
loaders: [{
test: /\.juicer.html$/,
loader: 'juicer-loader'
}]
}
};