Created
July 15, 2015 16:23
-
-
Save glenjamin/b069e148733105946233 to your computer and use it in GitHub Desktop.
Hack way to "hot reload" when server rendering via NodeJS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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