importmap-rails icon indicating copy to clipboard operation
importmap-rails copied to clipboard

Import Map doesn't support CDN based directories

Open MattStopa opened this issue 3 years ago • 1 comments

It seems that Import Map only supports the happy case of having to use a single file from a REPO for example:

pin "quill", to: "https://ga.jspm.io/npm:[email protected]/dist/quill.js"

In reality though, in order write custom plugins you tend to have to extend some existing classes. It would be nice to be able to say something like

pin_all_from "https://unpkg.com/[email protected]/", under: "quill"

and then be able to access different files via import "quill/dist/quill.js" Or at least have a "Download all files" option to vendor it. Otherwise if you need 10 files youd probably have to do:

pin "quill", to: "https://ga.jspm.io/npm:[email protected]/dist/quill.js"
pin "Bold", to: "https://ga.jspm.io/npm:[email protected]/fonts/bold.js"
pin "Italtic", to: "https://ga.jspm.io/npm:[email protected]/fonts/italtic.js"
etc, etc.

MattStopa avatar Jan 03 '22 08:01 MattStopa

Please do explore this!

dhh avatar Feb 19 '22 08:02 dhh