Last active
April 29, 2019 06:01
-
-
Save ff6347/782de3cba72c460eb637f898238c2179 to your computer and use it in GitHub Desktop.
ES6 Modules in the Browser. Run it with `npx reload`
This file contains hidden or 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 lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="x-ua-compatible" content="ie=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> | |
| <title>Page Title</title> | |
| <meta name="description" content="something"> | |
| <meta name="author" content="me"> | |
| </head> | |
| <body> | |
| <script type="module" src="./module.js"></script> | |
| <script type="module" src="./index.js"></script> | |
| </body> | |
| </html> |
This file contains hidden or 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 {hello} from './module.js' | |
| document.addEventListener('DOMContentLoaded',function() { | |
| console.info(hello('world')); | |
| }); |
This file contains hidden or 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 hello = (str) => `Hello ${str}!`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment