Rollup plugin to compile handlebar templates.
npm i rollup-plugin-handlebars -D
import { rollup } from 'rollup';
import handlebars from 'rollup-plugin-handlebars';
rollup({
entry: 'main.js',
plugins: [
handlebars()
]
});
<p>Hello {{name}}</p>
import the template.
import template from 'template.hbs';
console.log(template({name:'world'}))
import { rollup } from 'rollup';
import handlebars from 'rollup-plugin-handlebars';
import babel from 'rollup-plugin-babel';
import { minify } from 'uglify-js';
rollup({
entry: 'main.js',
plugins: [
handlebars({
//handlebar options
})
]
});
MIT © Benjamin Legrand