Hot Module Replacement runtime for Brunch
Latest commit 282faa4 Apr 21, 2016 @goshakkk goshakkk Revert "On by default"
This reverts commit ccb4d29.
Failed to load latest commit information.
.gitignore Initial commit Apr 18, 2016 Revert "On by default" Apr 21, 2016
index.js Revert "On by default" Apr 21, 2016
package.json Release 0.1.1. Apr 21, 2016
runtime.js Actually reload the page + preserve the reason Apr 19, 2016

HMR runtime for Brunch

Allows to use Hot Module Replacement in your Brunch projects.


  • Only works for JS files
  • Requires brunch v<unreleased> and later
  • Requires auto-reload-brunch v<unreleased> and later
  • Provides the main HMR API (but not Management API)
  • Works only if your JS compiles to a single file


Change your config:

exports.config = {
  hot: true,
  // ...

Then, just use the main HMR API:

import React from 'react';
import { Provider } from 'react-redux';
import { createStore } from 'redux';
import counterApp from './reducers';
import App from 'components/App';

const store = createStore(counterApp, 0);
// detect if we're loading for the first time or reloading
if ( {'./reducers', (d) => {

Note: in production env, hmr-brunch will strip all if ( { ... } conditionals.