importmap-rails
importmap-rails copied to clipboard
Import Map doesn't support CDN based directories
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.
Please do explore this!