ECMAScript leaves specifiers to the host; in browsers, HTML's resolve a module specifier algorithm turns them into URLs. Relative and absolute URLs (./, ../, /, https:) resolve against the importing module's URL; a bare specifier like 'chart' has no URL meaning, so without an import map it throws a TypeError.
An import map is JSON in an inline <script type="importmap"> with up to three keys:
imports: specifier → URL. A key ending in/maps a whole prefix:"chart/": "/vendor/chart@4/"sendschart/helpers.jsto/vendor/chart@4/helpers.js. URL-like keys work too (remap/js/app.jsto a hashed file); anullvalue blocks a specifier.scopes: URL prefix → its own specifier map, used only when the importing module's URL matches the prefix. Scopes are tried most-specific first, thenimports. This is how two versions of one package coexist.integrity: URL → SRI hash, applied to modules fetched throughimportandimport(). A top-level<script src>still uses its ownintegrityattribute.
Resolution order: matching scopes, then imports, then plain URL resolution, else TypeError. Within a map the most specific key wins, and a prefix match can't climb above its prefix with ../.
A document can now have several import maps. Each is merged into one global map when registered, even after modules have loaded, but a new rule is dropped if its scope and specifier already exist or if it would change an already-resolved specifier. Import maps can't be external: a src attribute fires an error event.
Support: import maps are Baseline widely available, in every major engine since March 2023. Multiple import maps aren't Baseline yet: Chrome 133 and Safari 18.4 ship them, Firefox only behind a flag. Node.js has no import maps; its docs show a resolve hook implementing a subset, and package.json "imports" covers in-package aliases.