Skip to content

Add single files to assets compilation #178

@morgoth

Description

@morgoth

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) ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions