Skip to content

Commit

Permalink
Add stylesheets to assets.excluded_paths
Browse files Browse the repository at this point in the history
Otherwise, propshaft will include all stylesheets in public/assets, even though they are already compiled inside of application.css. This is a known bug:

rails/propshaft#89
  • Loading branch information
Moncef Belyamani committed Feb 10, 2024
1 parent 3ad9039 commit 6aec740
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/initializers/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@
# application.js, application.css, and all non-JS/CSS in the app/assets
# folder are already added.
# Rails.application.config.assets.precompile += %w( admin.js admin.css )

# Propshaft includes all stylesheets in public/assets when only application.css is needed
# https://github.com/rails/propshaft/issues/89
Rails.application.config.assets.excluded_paths << File.join(Rails.root, 'app/assets/stylesheets')

0 comments on commit 6aec740

Please sign in to comment.