0.0.5 • Published 7 years ago

juicer-loader v0.0.5

Weekly downloads
17
License
-
Repository
github
Last release
7 years ago

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'
		}]
	}
};

reference

gulp-juicer2js

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago