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

Best practice: npm install react-hot-loader --save or --save-dev? #675

Closed
sachinrekhi opened this issue Oct 16, 2017 · 4 comments
Closed

Comments

@sachinrekhi
Copy link
Contributor

Apologies for the basic question, but I just upgraded react-hot-loader to 3.1.1 from 1.3.1 and followed the directions on the Getting Started Guide. And as such, I now have import { AppContainer } from 'react-hot-loader' in my index.js.

Previously when I installed react-hot-loader, I did it with --save-dev and saved it as a devDependency.

But it seems now with the latest version since I'm importing AppContainer in my index.js, I have to install with --save and have it as part of my main dependencies.

Is this the recommended best practice? Or should I find a way for the import to exist behind a development flag? Maybe similar to an approach like is typically done with configure-store.dev.js VS configure-store.prod.js for configuring redux stores?

I'm concerned about any potential performance issues as well as any potential increase in bundle size caused in production by including react-hot-loader in my main dependencies.

@gregberge
Copy link
Collaborator

Yes this is the recommended best pratice. React Hot Loader handles development and production environment by itself. As you can see, production AppContainer is very small and will not increase your build size.

@gregberge gregberge added the docs label Oct 16, 2017
@gregberge
Copy link
Collaborator

We should document it, because a lot of people are not serene with that.

@sachinrekhi
Copy link
Contributor Author

Took a stab at adding details on this to the README.

@gregberge
Copy link
Collaborator

@sachinrekhi thanks

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

No branches or pull requests

2 participants