-
-
Notifications
You must be signed in to change notification settings - Fork 631
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
Change custom precompile to check ReactOnRails.configuration.build_production_command present? #1402
Change custom precompile to check ReactOnRails.configuration.build_production_command present? #1402
Conversation
@gscarv13 pick this up. |
5be2095
to
5eaf115
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 2 files at r1, 4 of 4 files at r2, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions
CHANGELOG.md, line 21 at r2 (raw file):
#### Changed - Remove the documentation entries that asked to delete the `config/webpack/production.js` file if `config.build_production_command` is present [PR 1402](https://github.com/shakacode/react_on_rails/pull/1402)by [justin808](https://github.com/justin808) and [gscarv13](https://github.com/gscarv13).
Changed logic of determining the usage of the default rails/webpacker webpack config or a custom command to only check if the config.build_production_command is defined.
The point of the PR is to change the logic. We don't update the changelog with documentation commands.
docs/deployment/heroku-deployment.md, line 24 at r2 (raw file):
If you're a custom webpack configuration, and you **do not have the default `config/webpack/production.js`** file, then the `config/initializers/react_on_rails.rb` configuration `config.build_production_command` will be used.
Reword this for the change in logic.
docs/guides/configuration.md, line 70 at r2 (raw file):
if you don't want react_on_rails building this file for you.
if you don't want react_on_rails invoking this command
lib/tasks/assets.rake, line 12 at r2 (raw file):
skip_react_on_rails_precompile = %w[no false n f].include?(ENV["REACT_ON_RAILS_PRECOMPILE"]) if !skip_react_on_rails_precompile && ReactOnRails.configuration.build_production_command.present?
Test this logic for 4 cases:
- build_production_command script set, no /config/webpack/production.js exists ==> runs script
- build_production_command script set, and /config/webpack/production.js exists ==> runs script
- build_production_command script not set, and /config/webpack/production.js exists ==> runs this
- build_production_command script not set, and /config/webpack/production.js not existing ==> prints warning message? (check what it does)
593aeb2
to
78e5b99
Compare
f0a94ab
to
1a2bcbf
Compare
Update logic on what build command to use in assets:precompile to be based on whether or not
config.build_production_command is defined.
This change is