0Pricing
HTML Academy · Lesson

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

  1. ES Module Scripts type=module
  2. Import Maps importmap
  3. Dynamic Import() in Modules
  4. Module Federation Basics
← Back to HTML Academy