Brunch
HMR runtime forAllows to use Hot Module Replacement in your Brunch projects.
Constraints:
- 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
Usage
Change your config:
exportsconfig = hot: true // ...;
Then, just use the main HMR API:
;;;;; const store = ;// detect if we're loading for the first time or reloadingif modulehot modulehotaccept'./reducers' { store; };
Note: in production env, hmr-brunch
will strip all if (module.hot) { ... }
conditionals.