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/c3db36e89ddca3d2f3739431873b2581 to your computer and use it in GitHub Desktop.
Save dmnsgn/c3db36e89ddca3d2f3739431873b2581 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>ES modules in the browser - almost - now | Basics: script type module</title>
</head>
<body>
<!-- Use a type set to "module" with a fallback -->
<script type="module" src="app.js"></script>
<script nomodule src="fallback.js"></script>
<!-- Or inline the script -->
<script type="module">
import App from "./app.js";
console.log(App);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment