My 2 cents here.
I think there does need to be some mention on the HMR page stating that this is only meant to be used for development. This might seem obvious to some but it is important to explicitly state this in the docs in a couple different places.
IMO, it should be mentioned somewhere within the first opening paragraph in bold perhaps. Then at the bottom, as you did in your PR there should be a paragraph stating again that this is meant for development and that when shipping for production everyone should be at least starting at the building for production page.
As far as needing the coding example I'm not sure. Maybe it should be there because that page is essentially a tutorial on HMR. Not totally sure.
@AlexanderTserkovniy @johnstew added a fix for this to #1172 based on this discussion, please let me know if it needs tweaking. I think simpler is better there, and pointing users to the main production guide is best.
It looks good, but the PR, which I have proposed contains exact implementation. With example of implementation, we show clear way to avoid these issues on production, which could save someone's time.
It looks good, but the PR, which I have proposed contains exact implementation. With example of implementation, we show clear way to avoid these issues on production, which could save someone's time.
Yeah, I understand but I think we're trying to push people towards managing separate configurations instead of flagging on production.env.NODE_ENV to hack it out. Also the example you had would remove __all plugins__ not just the HotModuleReplacementPlugin. I think that by putting the warning right at the top of the page, people will at least glance at the building for production page so they know about split configs and can plan accordingly.
I also think adding a whole section dedicated to factoring it out within the hmr-react guide would take away from the main goal of that article and add duplicate content as to what's already in the production-build guide. Maybe another a more targeted link in the warning to here would help?
Most helpful comment
My 2 cents here.
I think there does need to be some mention on the HMR page stating that this is only meant to be used for development. This might seem obvious to some but it is important to explicitly state this in the docs in a couple different places.
IMO, it should be mentioned somewhere within the first opening paragraph in bold perhaps. Then at the bottom, as you did in your PR there should be a paragraph stating again that this is meant for development and that when shipping for production everyone should be at least starting at the building for production page.
As far as needing the coding example I'm not sure. Maybe it should be there because that page is essentially a tutorial on HMR. Not totally sure.