Last active
April 26, 2018 11:09
-
-
Save dmnsgn/05e9a1805e6e126f8c3de25d7c1f97c8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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