/babel-plugin-idom-bars-inline-precompile

Precompile inline Handlebars templates.

Primary LanguageJavaScript

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"]
});