Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In earlier versions of webpacker we have used Rails env as fallback env, which isn't ideal because both
NODE_ENV
andRAILS_ENV
has different meaning for different environments.For example: setting
NODE_ENV=production
means the webpacker will compile assets in production mode however at same timeRAILS_ENV
can be staging. Webpack and node libraries only understands development and production environments. However, it's normal to have many customRAILS_ENV
.This PR makes
RAILS_ENV
andNODE_ENV
independent of each other for clarity.Examples:
By default binstubs will use
NODE_ENV=development
however rake compile task will compile in production mode:# Compiles in development mode by default ./bin/webpack ./bin/webpack-dev-server
# Compiles in production mode NODE_ENV=production ./bin/webpack NODE_ENV=production ./bin/webpack-dev-server
TODO: