Rich-Harris / shimport

Use JavaScript modules in all browsers, including dynamic imports

Home Page:https://shimport-demos.surge.sh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature: URL resolver

gingur opened this issue · comments

First off, great work! I love how the solution converts ESM into an AMD like pattern. This works as a great polyfill, however I intend to use this without feature detection and always use it but with the hope I'd be able to inject my own URL resolver.

The ability to "alias" dependencies or optionally append .js to URL's that don't specify an extension would be a great addition to import that this polyfill might be able to provide. If you agree, I'd be more than happy to provide a PR.

Hey, sorry for the long-delayed response. Shimport is a polyfill, and as such I don't think it makes sense to add support for non-standard features. The only way it would be legitimate to add an additional resolving step would be if import maps become a thing.

just skimmed throgh some issues to look around
I don't need import maps or url resolver but @Rich-Harris is right the right step forward would be to use something like import maps