ES Module Scripts type=module
Load JavaScript as ES modules with type=module.
What Are ES Modules?
An ES module is a JavaScript file that uses import and export declarations. Modules have their own scope (no global pollution), strict mode by default, and explicit dependencies — fixing decades of script-tag-ordering problems.
The Module Script Tag
<script type="module" src="app.js"> tells the browser the file is a module. The browser parses imports, fetches dependencies in parallel, and only executes the entry once the entire dependency graph is downloaded and compiled.
<script type="module" src="app.js"></script>All lessons in this course
- ES Module Scripts type=module
- Import Maps importmap
- Dynamic Import() in Modules
- Module Federation Basics