blueimp-tmpl-loader
v0.0.3
Published
blueimp templates loader for webpack
Downloads
21
Maintainers
Readme
blueimp template loader for webpack
blueimp template loader for webpack. Compile templates and allows minification
Installation
npm install blueimp-tmpl-loader --save-dev
Usage
var template = require("blueimp-tmpl!./file.html");
// => returns the template function compiled with the tmpl templating engine.
// And then use it somewhere in your code
template(data) // Pass object with data
Alternatively you can also define blueimp-tmpl in your webpack.config file:
{
module: {
loaders: [
{ test: "\.tpl.html$", loader: "blueimp-tmpl" },
]}
}
var template = require('./file.tpl.html');
The blueimp-tmpl loader allows you to minify the html before compiling by setting a loader query string
{
module: {
loaders: [
{ test: "\.tpl.html$", loader: "html-tpl?minimize=true" }
]
}
Tests
Run unit tests:
npm install
npm test
Demo
http://jantimon.github.io/blueimp-tmpl-loader/
License
MIT (http://www.opensource.org/licenses/mit-license.php)