0.1.0 • Published 9 years ago
clear-tpl-loader v0.1.0
Lodash template for webpack
Lodash template loader for webpack. Uses _.template function to compile templates.
Installation
npm install clear-tpl-loader
Usage
var template = require("tpl!./file.html");
// => returns the template function compiled with undesrcore (lodash) templating engine.
// And then use it somewhere in your code
template(data) // Pass object with dataYou can add _.template settings as a tplSettings property inside webpack config file to specify options for the loader, for example:
    ...
    tplSettings: {
        escape: /\{\{([^{].*?)\}\}/gm,
        interpolate: /\{\{\{(.+?)\}\}\}/gm,
        evaluate: /\{\%(.+?)\%\}/g
    }
    ...License
0.1.0
9 years ago