WICG / import-maps

How to control the behavior of JavaScript imports
https://html.spec.whatwg.org/multipage/webappapis.html#import-maps
Other
2.65k stars 69 forks source link

import maps for `import()` statements #295

Closed trusktr closed 7 months ago

trusktr commented 7 months ago

It would be useful to be able to do this:

const importmap = {
  imports: {
    "some-lib": "https://example.com/some-lib",
    "other-lib": "https://example.com/other-lib",
    // ...
  },
}

const {foo} = await import('some-lib', { importmap })

this would make some use cases where HTML is already parsed and that HTML may already have had its own importmap:

domenic commented 7 months ago

This is an anti-goal of import maps: https://github.com/WICG/import-maps#scope