2014-12-15 23:00:49 +08:00
|
|
|
# Lodash template for webpack
|
2014-12-15 22:48:11 +08:00
|
|
|
|
2014-12-15 23:00:49 +08:00
|
|
|
Lodash template loader for [webpack](http://webpack.github.io/). Uses `_.template` function to compile templates.
|
2014-12-15 22:48:11 +08:00
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
2014-12-15 22:52:26 +08:00
|
|
|
`npm install tpl-loader`
|
2014-12-15 22:48:11 +08:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
[Documentation: Using loaders](http://webpack.github.io/docs/using-loaders.html)
|
|
|
|
|
|
|
|
``` javascript
|
2014-12-15 23:00:49 +08:00
|
|
|
var template = require("tpl!./file.html");
|
2014-12-15 22:48:11 +08:00
|
|
|
// => returns the template function compiled with undesrcore (lodash) templating engine.
|
|
|
|
|
|
|
|
// And then use it somewhere in your code
|
|
|
|
template(data) // Pass object with data
|
|
|
|
```
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
MIT (http://www.opensource.org/licenses/mit-license.php)
|
|
|
|
|
|
|
|
|
|
|
|
|