-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Staging config is not used #1696
Comments
Here's the line that would determine which One possibility that occurred to me is, if you've upgraded from earlier versions: be sure you regenerate the binstub and uninstall previous versions of the gem, as discussed here. |
Same issue here. Thanks to @rossta , i've debugged NODE_ENV in runner.rb and has production as value!!!! Now trying to find who/where is changing NODE_ENV |
Ooops, the compile rake task has hardcoded "production". Amazing ;-)
|
i think hardcoding was the way to decouple NODE_ENV and RAILS_ENV and still retain the rails-magic in making it just work for assets:precompile in production |
We have the same problem! So, why it does not use module Webpacker
class Runner
...
def initialize(argv)
...
#@webpack_config = File.join(@app_path, "config/webpack/#{ENV["NODE_ENV"]}.js")
@webpack_config = File.join(@app_path, "config/webpack/#{ENV["RAILS_ENV"]}.js")
...
end
end
end And the task namespace :webpacker do
task compile: ["webpacker:verify_install", :environment] do
Webpacker.with_node_env("production") do
...
end
end
end UPDATEHere a working example with our webpacker changes:
This works for us using |
Short Answer: Take the |
Could we close this issue? |
Using v3.5.5, I defined a new staging environment, in
config/webpacker.yml
I have:I also have the following in
config/webpack/staging.js
:This
staging.js
config does not seem to get incorporated into my pack at all when I built usingRAILS_ENV=staging NODE_ENV=staging bundle exec rails assets:precompile
, one of my packs utilizes this environment-specific variable.Regardless of whether
NODE_ENV
is set to production or staging, in any case it seems to be using the settings inconfig/webpack/production.js
rather thanconfig/webpack/staging.js
.The text was updated successfully, but these errors were encountered: