-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
How do I put React in production mode? #696
Comments
@Drillan767 You would need to set NODE_ENV=production bundle exec rails assets:precompile |
Thank you, it was way easier than I thought! |
@gauravtiwari @Drillan767 if you are hosting on a platform like Heroku, where do you set
?? |
You could set heroku config:set NODE_ENV=production and redeploy |
@gauravtiwari Wow! that's quite straightforward. Thanks for the quick reply. |
If it might help, I recently learned that running "rails webpacker:compile" without providing any environment will set the ENV to "production" by default (and do the work) |
I read the documentation quite a lot of time but i still can't figure this out, I finished building and compiling my application using Webpacker and React, but I just noticed that the React extension in my Chrome browser says that I'm using the development mode of React. How do I set it to production?
I read a lot of StackOverflow posts saying that you need to edit the package.json file and add some elements in it, but it always refer to a
webpack.config.js
, and i'm not really sure about where I cand find this file -- if it exists anywhere else than innode_module
.My most sincere apologies if this is an already asked question or if the answer is obvious, but I can't anything about this topic anywhere.
The text was updated successfully, but these errors were encountered: