importmap-rails
importmap-rails copied to clipboard
Automatically add pinned files to assets.precompile
Hi, I wanted to get thoughts on automatically adding pinned files to Rails.application.config.assets.precompile
. I think it could eliminate complexity for both gem maintainers and gem users. Gem maintainers wouldn't need any additional engine code and gem users wouldn't need to remove assets if they're not using importmap-rails
.
A few examples of complexity that could be eliminated:
Maybe I'm misunderstanding, but isn't this already done here? https://github.com/rails/importmap-rails/blob/main/lib/importmap/engine.rb#L44-L46
That adds the shim to the precompile list. If you comment out the highlighted lines in any of the gems above, you'll get Sprockets::Rails::Helper::AssetNotPrecompiledError
.
@ankane Ah, I see. This is mainly for gems. When you said pinned files, I thought you meant files inside the Rails app, which I believe are precompiled, since they are in app.config.assets.paths
, right? I don't fully understand the difference between app.config.assets.paths
and app.config.assets.precompile
🤔
I'd be happy to see this.