← Back to release summary

JavaScript modules: <script type=module>

Category
JavaScript
Type
New or changed feature
Status
Enabled by default (Chrome 61)
Intent stage
None

Summary

JavaScript modules allow a program to be divided into multiple sequences of statements and declarations. Each module explicitly identifies declarations it uses that need to be provided by other modules and which of its declarations are available for use by other modules. <script type=module> allows loading of JavaScript modules inside web pages.

Standards & signals

Docs: https://blog.whatwg.org/js-modules http://tc39.github.io/ecma262/#sec-modules https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script https://jakearchibald.com/2017/es-modules-in-browsers/

Samples: https://paulirish.github.io/es-modules-todomvc/

View on chromestatus.com