JavaScript modules
Widely Available (since 2020-11-09)
JavaScript 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">.
Browser support (view on caniuse.com)
- Chrome 61 Released on 2017-09-05
- Chrome Android 61 Released on 2017-09-05
- Edge 16 Released on 2017-10-17
- Firefox 60 Released on 2018-05-09
- Firefox for Android 60 Released on 2018-05-09
- Safari 11 Released on 2017-09-19
- Safari on iOS 11 Released on 2017-09-19
MDN documentation
Specifications
- HTML (#javascript-module-script), from HTML Workstream (WHATWG).
- ECMAScript® 2027 Language Specification (#sec-modules), from TC39 (Ecma International).
Usage (according to Chrome Platform Status)
~30.619% of page loads. More data at chromestatus.com.Web Platform Tests (WPT)
View the latest WPT test results for this featureView as JSON | Edit this feature | Report an issue | Web-features entry: source, dist