JSPM

ftl-loader

0.2.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q17218F
  • License MIT

Freemarker webpack loader (without frontend dependencies)

Package Exports

  • ftl-loader

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ftl-loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ftl-loader for webpack

Freemarker loader for webpack. Uses Freemarker function to compile templates.

To use Freemarker.js by ijse use 1.2 branch.

Installation

npm install ftl-loader

Usage

Documentation: Using loaders

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

module: {
  loaders: [
    {test: /\.ftl$/, loader: 'ftl?htmlmin'} // enable here
  ]
},
'ftl-loader': {
  'htmlmin': true, // or enable here  
  'htmlminOptions': {
    removeComments: true
  }
}

See all options reference

License

MIT (http://www.opensource.org/licenses/mit-license.php)