Skip to content
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

excluded_paths requires an exact match? #233

Open
jagthedrummer opened this issue Feb 11, 2025 · 0 comments
Open

excluded_paths requires an exact match? #233

jagthedrummer opened this issue Feb 11, 2025 · 0 comments

Comments

@jagthedrummer
Copy link

I'm trying to exclude some assets provided by the avo gem, and I've added this to config/initializers/assets.rb:

Rails.application.config.assets.excluded_paths = [
  Avo::Engine.root.join("app/assets")
]

But I'm still getting assets from avo in public/assets/avo when I precompile assets.

If I inspect Rails.application.config.assets.paths in a console I can see that there are paths for several avo asset directories:

> Rails.application.config.assets.paths
=>
[
# snip
 "/Users/jgreen/.asdf/installs/ruby/3.4.1/lib/ruby/gems/3.4.0/gems/avo-3.17.2/app/assets/builds",
 "/Users/jgreen/.asdf/installs/ruby/3.4.1/lib/ruby/gems/3.4.0/gems/avo-3.17.2/app/assets/config",
 "/Users/jgreen/.asdf/installs/ruby/3.4.1/lib/ruby/gems/3.4.0/gems/avo-3.17.2/app/assets/stylesheets",
 "/Users/jgreen/.asdf/installs/ruby/3.4.1/lib/ruby/gems/3.4.0/gems/avo-3.17.2/app/assets/svgs",
# snip
]

If I explicitly add each of those sub directories to excluded_paths then it works to exclude the avo assets.

Rails.application.config.assets.excluded_paths = [
  Avo::Engine.root.join("app/assets/builds"),
  Avo::Engine.root.join("app/assets/config"),
  Avo::Engine.root.join("app/assets/stylesheets"),
  Avo::Engine.root.join("app/assets/svgs")
]

I would expect that Avo::Engine.root.join("app/assets/builds") (for example) should automatically be excluded when the parent directory of Avo::Engine.root.join("app/assets") is excluded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant