Skip to content

Instantly share code, notes, and snippets.

@thisisjofrank
Created April 22, 2022 13:15
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 thisisjofrank/7cb08424fd10f13edf020573483a1a9b to your computer and use it in GitHub Desktop.
Save thisisjofrank/7cb08424fd10f13edf020573483a1a9b to your computer and use it in GitHub Desktop.
Notice the reference to ./script.ts uses type="module" in the script tag. ES Modules makes it possible for the browser to import script.ts as a module in the front end. (This means that we can use browser native import statements in the JavaScript code).
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example</title>
<script src="./script.ts" type="module"></script>
</head>
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment