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.
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 Standard (#dom-worker-dev), from HTML Workstream (WHATWG).