JavaScript modules in workers
Newly available since 2023-06-06
The Worker()
constructor accepts { type: "module" }
to load scripts that use import
and export
. Also known as ECMAScript modules or ESM in workers.
Learning resources on MDN
Browser support
- Chrome 80 Released on 2020-02-04
- Chrome Android 80 Released on 2020-02-04
- Edge 80 Released on 2020-02-07
- Firefox 114 Released on 2023-06-06
- Firefox for Android 114 Released on 2023-06-06
- Safari 15 Released on 2021-09-20
- Safari on iOS 15 Released on 2021-09-20
Specifications
- HTML (#dom-worker-dev), from HTML Workstream (WHATWG).
View web-platform-tests results for this feature - View the feature source file - Edit the feature - Report an issue about this feature