0.0.3 • Published 9 years ago

blueimp-tmpl-loader v0.0.3

Weekly downloads
5
License
MIT
Repository
github
Last release
9 years ago

blueimp template loader for webpack

Build Status Dependency Status

blueimp template loader for webpack. Compile templates and allows minification

Installation

npm install blueimp-tmpl-loader --save-dev

Usage

Documentation: Using loaders

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

Build Status

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)