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.
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.
With import maps, you can even use bare import specifiers instead of URLs: