-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
NODE_ENV needs to default to 'development' if not set #183
Comments
@tomdracz @Judahmeek @alexeyr-ci1 please review. |
Makes sense to me, looks like a sensible change! |
Agreed. |
Some people may be using the stubs directly. My suggestion would be to change them as well instead of removing. |
Yes, remove from the binstubs installed, and be sure to mention this in the CHANGELOG. |
Problem
NODE_ENV
==test
needs to be saved for JS only code, such as running Jest and Storybook, and NEVER for rspec or other integration tests.Broken originally, like this:
https://github.com/rails/webpacker/blame/93386ed7e85928b38b46f3f3dd259ae3a9e59090/lib/install/bin/webpack
Fixed:
rails/webpacker#1359
https://github.com/rails/webpacker/blame/33b6c05ddb615ffa1a860c274372e21876d71c01/lib/install/bin/webpack
But if one forgets to set NODE_ENV for production builds, the JS code is not optimized!
This change broke the functionality:
https://github.com/shakacode/shakapacker/blame/master/lib/install/bin/webpacker#L9
The Suggested Fix
NODE_ENV
==production
But since this code is only updated when one makes a new install, let's move the change here:
from the binstub
And update this file:
https://github.com/shakacode/shakapacker/blob/master/lib/webpacker/runner.rb
And then, the upgrade instructions suggest removing the setting of the NODE_ENV from the bin stubs.
The text was updated successfully, but these errors were encountered: