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
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Allows to use Hot Module Replacement in your Brunch projects.
Constraints:
<unreleased>
and laterauto-reload-brunch
v<unreleased>
and laterChange 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.