Skip to content

Reloader and pin_all_from not picking up assets transformed by the asset pipeline #78

Open
@mtgrosser

Description

@mtgrosser

Currently, importmaps don't work properly with JS assets which have their filename extension transformed by the Rails asset pipeline from something other than .js to .js:

  • pin_all_from only matches .js(m) files
  • The cache sweeper file watcher only watches for .js files

Use cases for other filename extensions include:

  • the default Sprockets functionality of transforming .js.erb to .js
  • transformations for framework-specific file formats like .vue and .jsx

For example, we are using the jass-vue-sfc gem to transform .vue components into ES modules, which are then loaded by import maps. The same can be achieved for JSX files with jass-react-jsx.

In PR #57 I'm proposing adding config.importmap.accept which would allow importmaps to pin other filename extensions than .js, while staying agnostic to the asset pipeline used.

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