Join GitHub today
Support HMR #2
This PR fixes a problem we see when Hot Module Reloading is running and some modules have different versions of react and therefore different injected header / footer stanzas.
One header version
Another header version
This fixes that problem by first sanitizing the modules.
Does this scale?
The sanitization is super verbose so that it is really fast. In our app webpack bootstrap went from 800ms to 1,300ms which is not that bad considering the extra work we do.
This was referenced
Dec 2, 2016
Sure, the magic numbers come from looking at the injected footer and loader and making some assumptions on their lengths.
For instance, a module does not have a header + footer and fewer than 400 chars...
Sorry for the complex code, honestly it works well for us on some big apps... but without tests its hard to promise it will work for everyone