Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/justinidlerz/ftl-loader
Freemarker loader for webpack
https://github.com/justinidlerz/ftl-loader
Last synced: 16 days ago
JSON representation
Freemarker loader for webpack
- Host: GitHub
- URL: https://github.com/justinidlerz/ftl-loader
- Owner: Justinidlerz
- License: mit
- Created: 2016-07-05T06:42:22.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-07-05T06:56:35.000Z (over 8 years ago)
- Last Synced: 2024-10-04T13:27:46.544Z (about 1 month ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/ftl-loader
- Size: 4.88 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ftl-loader for webpack
Freemarker loader for [webpack](http://webpack.github.io/). Uses [Freemarker](http://freemarker.org) function to compile templates.
To use [Freemarker.js by ijse](https://github.com/ijse/freemarker.js) use 1.2 branch.
## Installation
`npm install ftl-loader`
## Usage
[Documentation: Using loaders](http://webpack.github.io/docs/using-loaders.html)
``` javascript
var template = require("ftl!./file.ftl");
// => returns the template function compiled with ftl templating engine.// And then use it somewhere in your code
template(data) // Pass object with data// Child Templates
// path is relative to where webpack is being run
<#include templates/child >
```## Options
Following options can be specified in query:
`htmlmin` — see [htmlminify section](#htmlminify)
## htmlminify
```javascript
module: {
loaders: [
{test: /\.ftl$/, loader: 'ftl?htmlmin'} // enable here
]
},
'ftl-loader': {
'htmlmin': true, // or enable here
'htmlminOptions': {
removeComments: true
}
}
```See [all options reference](https://github.com/kangax/html-minifier#options-quick-reference)
## License
MIT (http://www.opensource.org/licenses/mit-license.php)