Skip to content

External import maps #6026

@lgarron

Description

@lgarron

Chrome supports inline import maps:

<script type="importmap">
{
  "imports": {
    "cubing/alg": "https://cdn.cubing.net/js/cubing/alg",
    "cubing/twisty": "https://cdn.cubing.net/js/cubing/twisty"
  }
}
</script>

But not this:

<script type="importmap" src="import-map.importmap"></script>

If you try to use the latter, you get an error:

External import maps are not yet supported.

Import maps are all about ergonomics, and being able to reuse an import map without adding it into the source of every page is an important part of that functionality. It's always been in the spec, it just hasn't been implemented by any browsers yet.

Would it make more sense to annotate https://caniuse.com/import-maps with "partial support" (for browsers that support inline import maps) or to add a separate entry for external import maps?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions