Skip to content

sirzxj/juicer-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A webpack loader for juicer template

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published