Skip to content

Instantly share code, notes, and snippets.

@dmnsgn
Last active April 26, 2018 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmnsgn/05e9a1805e6e126f8c3de25d7c1f97c8 to your computer and use it in GitHub Desktop.
Save dmnsgn/05e9a1805e6e126f8c3de25d7c1f97c8 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>ES modules in the browser - almost - now | Package name maps</title>
</head>
<body>
<!-- Declare the package map -->
<script type="packagemap">
{
"path_prefix": "/node_modules",
"packages": {
"lodash": { "path": "lodash-es", "main": "lodash.js" }
}
}
</script>
<!-- Bare import will be mapped -->
<script type="module">
import { clamp } from "lodash";
// => import { partition } from "/node_modules/lodash-es/lodash.js";
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment