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

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

Open
mtgrosser opened this issue Dec 2, 2021 · 0 comments

Comments

@mtgrosser
Copy link

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.

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

1 participant