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

Specify NODE_ENV in the production build command #1053

Merged
merged 1 commit into from
Apr 10, 2018
Merged

Specify NODE_ENV in the production build command #1053

merged 1 commit into from
Apr 10, 2018

Conversation

RKushnir
Copy link
Contributor

@RKushnir RKushnir commented Apr 4, 2018

Hi,
Recently webpacker gem has been updated in a way to make NODE_ENV not fallback to RAILS_ENV(rails/webpacker@e616184).
By default react_on_rails generates this config:

config.build_production_command = 'RAILS_ENV=production bin/webpack'

Before the change in webpacker, this was effectively setting both RAILS_ENV and NODE_ENV to "production", but not anymore. Now NODE_ENV defaults to "development". So if you don't specify it, your production assets will be compiled using dev settings.


This change is Reviewable

@coveralls
Copy link

coveralls commented Apr 4, 2018

Coverage Status

Coverage remained the same at ?% when pulling 5c92f2d on RKushnir:patch-1 into a1932d9 on shakacode:master.

@justin808
Copy link
Member

:lgtm:


Reviewed 1 of 1 files at r1.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@justin808
Copy link
Member

@RKushnir Can you please add an entry to the CHANGELOG.md and I'll merge.


Review status: :shipit: all files reviewed at latest revision, all discussions resolved, all commit checks successful.


Comments from Reviewable

Due to the changes in the default settings of webpacker, `NODE_ENV` is no longer getting set to `RAILS_ENV` as a fallback, instead it defaults to "development".
@RKushnir
Copy link
Contributor Author

RKushnir commented Apr 5, 2018

@justin808 Ready.

@justin808 justin808 merged commit d2ab1ba into shakacode:master Apr 10, 2018
@justin808
Copy link
Member

Thanks @RKushnir!

@RKushnir RKushnir deleted the patch-1 branch April 10, 2018 06:46
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 this pull request may close these issues.

3 participants