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.
I'm trying to exclude some assets provided by the
avogem, and I've added this toconfig/initializers/assets.rb:But I'm still getting assets from
avoinpublic/assets/avowhen I precompile assets.If I inspect
Rails.application.config.assets.pathsin a console I can see that there are paths for severalavoasset directories:If I explicitly add each of those sub directories to
excluded_pathsthen it works to exclude theavoassets.I would expect that
Avo::Engine.root.join("app/assets/builds")(for example) should automatically be excluded when the parent directory ofAvo::Engine.root.join("app/assets")is excluded.