You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.js
filesUse cases for other filename extensions include:
.js.erb
to.js
.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 withjass-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.The text was updated successfully, but these errors were encountered: