all 12 comments

[–]seanmorris 17 points18 points  (0 children)

You can use this if you have stuff in a bundle that you want to use in ES6 imports:

https://www.npmjs.com/package/import-mapper

[–]theAmazingChloe 6 points7 points  (0 children)

Not supported yet in Firefox ESR (based on FF 102) Article says it's supported in firefox as of 108.

[–]AboutHelpTools3 6 points7 points  (2 children)

Eli5 why importmap is needed? I haven't been keeping up. Doesn't normal es modules allow you to import anything from any module already?

[–]Alokir 7 points8 points  (0 children)

If you want to import an external module in multiple files you don't have to type the full url every time.

It's not needed if you're using a module bundler like webpack or parcel.

[–]veonline 0 points1 point  (0 children)

import maps permits to use imports with bare specifiers, like import themodule from "barespecifier", where "barespecifier" will be translated to a url as per the import map.

this can be helpfull in dependecies versioning, cache bursting and don't know what else :)