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

Document that react-hot-loader/babel should now be used in production too #1104

Closed
edmorley opened this issue Nov 19, 2018 · 6 comments · Fixed by #1397
Closed

Document that react-hot-loader/babel should now be used in production too #1104

edmorley opened this issue Nov 19, 2018 · 6 comments · Fixed by #1397

Comments

@edmorley
Copy link
Contributor

In #1081 the RHL Babel plugin for when process.env.NODE_ENV is production was changed from a no-op to a plugin that removes the hot() wrapper.

This means it's now recommended to not only use the plugin in development, but in any production configs too.

As such, it would be good to update the docs to say that react-hot-loader/babel should be used in all environments. eg here:
https://github.com/gaearon/react-hot-loader#getting-started
https://github.com/gaearon/react-hot-loader#migrating-from-create-react-app

CC @smelukov

@smelukov
Copy link
Contributor

@edmorley Good idea. Are you willing to do this by your self?

@edmorley
Copy link
Contributor Author

I might have a chance to open a PR in a week or two, but quite a few other things pending at the moment :-)

@mrtnbroder
Copy link

I don't exactly get why is it recommended to have hot also in production? To me it sounds more like "it doesn't matter if you have hot in production or not, as it will be removed anyway".

@theKashey
Copy link
Collaborator

hot in production does nothing, but(!) - as long as you have passed a magic module variable inside - it will disable webpack module concatenation. That's why it's good to remove it completely.

@DinerIsmail
Copy link

DinerIsmail commented Dec 5, 2018

@theKashey can you please detail that a bit more? How do you know that it disables webpack module concatenation? Also, did you mean that happens when we use the plugin in production config (i.e. in babelrc setting "react-hot-loader/babel" in the general section, and not just in env.development.plugins)?

@theKashey
Copy link
Collaborator

@DinerIsmail - see #1080

silvenon added a commit to silvenon/react-hot-loader that referenced this issue Nov 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants