Last active
March 5, 2020 20:55
-
-
Save davidgilbertson/0e0475f25564769a4dc88ee1f6e124de to your computer and use it in GitHub Desktop.
ES Modules in the browser
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> | |
<body> | |
<div id="app"></div> | |
<script type="module" src="index.mjs"></script> | |
<!--note the "module" bit--> | |
</body> | |
</html> |
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
import { doSomething } from './utils.mjs'; | |
doSomething('Make me a sandwich'); |
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
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