brunch/hmr-brunch

Name: hmr-brunch

Owner: Brunch

Description: Hot Module Replacement runtime for Brunch

Created: 2016-04-18 12:16:01.0

Updated: 2017-12-12 04:10:27.0

Pushed: 2018-03-25 02:36:55.0

Homepage: null

Size: 14

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

HMR runtime for Brunch

Allows to use Hot Module Replacement in your Brunch projects.

Constraints:

Usage

Change your config:

le.exports = {
t: true,
 ...

Then, just use the main HMR API:

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

t store = createStore(counterApp, 0);
etect if we're loading for the first time or reloading
module.hot) {
dule.hot.accept('./reducers', (d) => {
store.replaceReducer(require('./reducers').default);
;

Note: in production environment, hmr-brunch will strip all if (module.hot) { ... } conditionals.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.