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

Automatically add pinned files to assets.precompile #166

Open
ankane opened this issue Jan 7, 2023 · 4 comments
Open

Automatically add pinned files to assets.precompile #166

ankane opened this issue Jan 7, 2023 · 4 comments

Comments

@ankane
Copy link
Contributor

ankane commented Jan 7, 2023

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:

@dkniffin
Copy link
Contributor

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

@ankane
Copy link
Contributor Author

ankane commented Feb 17, 2023

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.

@dkniffin
Copy link
Contributor

dkniffin commented Feb 20, 2023

@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 🤔

@dhh
Copy link
Member

dhh commented Jun 18, 2023

I'd be happy to see this.

@dhh dhh closed this as completed Jun 18, 2023
@dhh dhh reopened this Jun 18, 2023
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

3 participants