Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HMR add simple Production section #649

Closed
AlexanderTserkovniy opened this issue Jan 16, 2017 · 4 comments
Closed

HMR add simple Production section #649

AlexanderTserkovniy opened this issue Jan 16, 2017 · 4 comments
Labels

Comments

@AlexanderTserkovniy
Copy link

In order to get it work without errors and warns in console on production, it is required to add simple Production section for HMR page.

In process of doing pull request...

AlexanderTserkovniy added a commit to AlexanderTserkovniy/webpack.js.org that referenced this issue Jan 16, 2017
Production section explains how to get rid out of HMR error and warn logs after production compilation.

It contains plain recommendations for production bundling.

Fix webpack#649
AlexanderTserkovniy added a commit to AlexanderTserkovniy/webpack.js.org that referenced this issue Jan 17, 2017
…logs after production compilation.

It contains plain recommendations for production bundling.

Fix webpack#649
Fix typos after review.
@johnstew
Copy link

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.

@skipjack
Copy link
Collaborator

@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.

@AlexanderTserkovniy
Copy link
Author

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.

@skipjack
Copy link
Collaborator

skipjack commented Apr 29, 2017

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants