Skip to content

Instantly share code, notes, and snippets.

@glenjamin
Created July 15, 2015 16:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glenjamin/b069e148733105946233 to your computer and use it in GitHub Desktop.
Save glenjamin/b069e148733105946233 to your computer and use it in GitHub Desktop.
Hack way to "hot reload" when server rendering via NodeJS
// assuming that the React app is inside /client/
// clear cached client modules so next server render uses new stuff
webpack.plugin('done', function() {
Object.keys(require.cache).forEach(id => {
if (/\/client\//.test(id)) {
delete require.cache[id];
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment