Skip to content

Commit

Permalink
Use computed asset host
Browse files Browse the repository at this point in the history
`config.action_controller.asset_host` won’t work when:
* It’s a Proc
* It’s nil (the application may set `ActionController::Base.asset_host` directly)
  • Loading branch information
javan committed May 17, 2017
1 parent 70eace2 commit 28fc868
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tasks/webpacker/compile.rake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace :webpacker do
desc "Compile javascript packs using webpack for production with digests"
task compile: ["webpacker:verify_install", :environment] do
puts "Compiling webpacker assets 🎉"
asset_host = Rails.application.config.action_controller.asset_host
asset_host = ActionController::Base.helpers.compute_asset_host
asset_env = asset_host ? "ASSET_HOST=#{asset_host}" : ""
result = `#{asset_env} NODE_ENV=#{Webpacker.env} ./bin/webpack --json`

Expand Down

0 comments on commit 28fc868

Please sign in to comment.