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

Add single files to assets compilation #178

Open
morgoth opened this issue Jan 22, 2024 · 2 comments
Open

Add single files to assets compilation #178

morgoth opened this issue Jan 22, 2024 · 2 comments

Comments

@morgoth
Copy link
Member

morgoth commented Jan 22, 2024

Looking at https://github.com/rails/cssbundling-rails/pull/147/files It's a nice way to pin javascript files from node packages.

However this example includes all the files that are placed in given directory, ie

Rails.application.config.assets.paths << Rails.root.join("node_modules/bootstrap/dist/js")
will output on rails assets:reveal:

...
bootstrap.min.js.map
bootstrap.esm.js.map
bootstrap.bundle.js
bootstrap.esm.js
bootstrap.js
bootstrap.min.js
bootstrap.bundle.min.js
bootstrap.bundle.min.js.map
bootstrap.bundle.js.map
bootstrap.js.map
bootstrap.esm.min.js
bootstrap.esm.min.js.map
...

So all those files will be digested and put in public path.
Looks like it's not possible to pick only one file or exclude any others from digesting as the config.assets.excluded_paths and config.assets.paths takes directories only.

Is there any way to achieve this?

It's softly connected to https://github.com/rails/propshaft/issues/89`

@brenogazzola did you have a chance to look at paths handling, vide #89 (comment) ?

@brenogazzola
Copy link
Collaborator

We discussed a few options and David said he'd think about it and come up with something himself. I'll ping him about it.

@mjansing
Copy link

Any updates on this? I'm also interested in a solution.

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