Skip to content

Packages support (sourcemaps) #12

@PaperPrototype

Description

@PaperPrototype

Using sourcemaps you can alias the import of libraries

esm.sh allows you to import JavaScript modules from http URLs, no installation/build steps needed.

import * as mod from "https://esm.sh/PKG[@SEMVER][/PATH]";

With import maps, you can even use bare import specifiers instead of URLs:

<script type="importmap">
  {
    "imports": {
      "react": "https://esm.sh/react@19.1.0",
      "react-dom/": "https://esm.sh/react-dom@19.1.0/"
    }
  }
</script>
<script type="module">
  import React from "react"; // → https://esm.sh/react@19.1.0
  import { render } from "react-dom/client"; // → https://esm.sh/react-dom@19.1.0/client
</script>

More usages about import maps can be found in the Using Import Maps section.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions