juicer-loader
v0.0.5
Published
A webpack loader for juicer template engine
Downloads
9
Maintainers
Readme
juicer-loader
A webpack loader to pre-build juicer.
Usage
1、 Install juicer-loader
npm install juicer-loader --save-dev
2、Write juicer filename hello.juicer.html
<div>
My name is $${name}
{@each list as item,k}
<div>${item.name},${k}</div>
{@/each}
</div>
3、Include your juicer file in js
var tpl = require('./hello.juicer.html');
console.log(tpl({
name: '<div>伯方</div>',
list:[
{name:1},
{name:'bf'}
]
}));
4、Add loader into your webpack.config.js
:
module.exports = {
entry: './src/index.js',
output: {
filename: 'build/bundle.js'
},
module: {
loaders: [{
test: /\.juicer.html$/,
loader: 'juicer-loader'
}]
}
};