2026
2 featuresThe navigator.serviceWorker.register() method accepts { type: "module" } to load scripts that use import and export. Also known as ECMAScript modules or ESM in service workers.
2023
1 featuresThe Worker() constructor accepts { type: "module" } to load scripts that use import and export. Also known as ECMAScript modules or ESM in workers.
2018
1 featuresJavaScript modules allow code to be organized into reusable units. Modules use import to load other modules and export to declare what is available to import from other modules. In HTML, modules are loaded with <script type="module">.
Limited Availability
3 featuresModule import … assert { type: "json" } and import … assert { type: "css" } JavaScript statements load JSON and CSS data.
Module import … with { type: "text" } statements load text data as a string value.
The import defer JavaScript statement imports a module while deferring its evaluation until its first use.