Skip to content

Commit

Permalink
Explain path sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
dhh authored Sep 23, 2024
1 parent 7b237f8 commit 06b911e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/propshaft/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ class Railtie < ::Rails::Railtie
end

config.after_initialize do |app|
# Prioritize assets from within the application over assets of the same path from engines/gems.
config.assets.paths.sort_by! { |path| path.to_s.start_with?(Rails.root.to_s) ? 0 : 1 }

config.assets.relative_url_root ||= app.config.relative_url_root
config.assets.output_path ||=
Pathname.new(File.join(app.config.paths["public"].first, app.config.assets.prefix))
Expand Down

0 comments on commit 06b911e

Please sign in to comment.