Skip to content

just-boris/handlebars-hot-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

  1. npm install handlebars-hot-loader
  2. npm install regions-extras – this step is nessesary, because we need to instrument our marionette packages
  3. Add the loader into your Webpack configuration
module: {
  loaders: [
    {
      test: /\.hbs/,
      loader: 'handlebars-hot!handlebars'
    }
  ]
},
  1. Instrument Marionette Views to work with hotload. Add the following in your application code.
require('regions-extras').register({
    Handlebars: Handlebars,
    Marionette: Marionette
});

About

Hot reload for Handlebars templates with injectify

Resources

Stars

Watchers

Forks

Packages

No packages published