-
-
Notifications
You must be signed in to change notification settings - Fork 633
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
react_on_rails 8.0.0 not generating production builds by default #875
Comments
@serodriguez68 Good catch. GeneratorIn the case of the generator, we're generating the simplest possible config file, so it's not optimized for production. We should probably use the "-p" option for Webpack (see references below). https://webpack.js.org/guides/production/#the-automatic-way
reactrails.comPlease report that to the https://github.com/shakacode/react-webpack-rails-tutorial. @Judahmeek @udovenko @robwise Opinions? |
yeah use |
…rails#875 * Minification using UglifyJsPlugin * Runs the LoaderOptionsPlugin * Sets the NodeJS environment variable triggering certain packages to compile differently
And I found the |
Ideally the generator should produce a client/package.json file that is ready to go for production builds. I'm not familiar with react_on_rails codebase so I'm not sure where to make the change to make this happen. Does doing the following change on this file makes the trick? Change this:
For this:
|
Please submit a PR and I'll merge it! Even better if there's a unit test! Also, please see https://github.com/shakacode/react_on_rails/blob/master/CONTRIBUTING.md for some basic PR hygiene like updating the https://github.com/shakacode/react_on_rails/blob/master/CHANGELOG.md |
Ok I just submitted PR 895 that fixes that. |
Fixed in #895. |
I upgraded a project I built for learning purposes from react_on_rails version 7 to version 8.0.0 and noticed that when deploying to Heroku, webpack no longer generates a minified production build of React (I can tell because I'm using the react extension for Chrome).
I upgraded using the generator from scratch and moving my code to the newly generated /client folder.
The source code of my project can be found here.
This is also happening with the www.reactrails.com app on version 8.
Is this a bug? or am I missing something in the client/webpack.config.js file?
The text was updated successfully, but these errors were encountered: