handlebars-hot-loader
v0.0.1
Published
Hot module reload for Handlebars templates
Downloads
5
Maintainers
Readme
Handlebars-hot-loader
Hot reload for Handlebars templates within Backbone or Marionette.
Webpack has Hot Module Replacement feature. It means that you can update your modules without full page reload. Now you can do it with Handlebars templates as well!
Getting started
This thing intended to use in Marionette.js project. Also you need to have configured Webpack build for your project. If you still haven't done yet, read the Webpack docs.
We work as separate loader on top your handlebars-loader, so you still need to use handlebars-loader.
See example directory to see how it works.
Installation
Once you have working Webpack build with hot reload, do the following:
npm install handlebars-hot-loader
npm install regions-extras
– this step is nessesary, because we need to instrument our marionette packages- Add the loader into your Webpack configuration
module: {
loaders: [
{
test: /\.hbs/,
loader: 'handlebars-hotloader!handlebars'
}
]
},
- Instrument Marionette Views to work with hotload. Add the following in your application code.
require('regions-extras').register({
Handlebars: Handlebars,
Marionette: Marionette
});