@roundingwellos/babel-plugin-handlebars-inline-precompile
v3.0.1
Published
Precompile inline Handlebars templates.
Downloads
275
Keywords
Readme
babel-plugin-handlebars-inline-precompile
Precompile inline Handlebars templates.
Example
In
import hbs from 'handlebars-inline-precompile';
hbs`Hello World!`;
Out
import _Handlebars from 'handlebars/runtime';
_Handlebars.template({ /* A bunch of crazy template stuff */ })
Installation
$ npm install babel-plugin-handlebars-inline-precompile
Usage
Via .babelrc
(Recommended)
.babelrc
{
"plugins": ["handlebars-inline-precompile"]
}
Via CLI
$ babel --plugins handlebars-inline-precompile script.js
Via Node API
require("babel-core").transform("code", {
plugins: ["handlebars-inline-precompile"]
});