Skip to content

Instantly share code, notes, and snippets.

@davidgilbertson
Last active March 5, 2020 20:55
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 davidgilbertson/0e0475f25564769a4dc88ee1f6e124de to your computer and use it in GitHub Desktop.
Save davidgilbertson/0e0475f25564769a4dc88ee1f6e124de to your computer and use it in GitHub Desktop.
ES Modules in the browser
<!DOCTYPE html>
<html>
<body>
<div id="app"></div>
<script type="module" src="index.mjs"></script>
<!--note the "module" bit-->
</body>
</html>
import { doSomething } from './utils.mjs';
doSomething('Make me a sandwich');
export const doSomething = message => {
console.log('No.');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment