ES6 Module Loader Polyfill dynamically loads ES6 modules in browsers and NodeJS with support for loading existing and custom module formats through loader hooks.
Dynamically loads ES6 modules in browsers and NodeJS with support for loading existing and custom module formats through loader hooks.
This project implements dynamic module loading through System
exactly to the previous ES6-specified loader API at 2014-08-24 ES6 Specification Draft Rev 27, Section 15. The specification for the module loader was removed from the ES6/ES2015 specification in 2014, and a new loader implementing the new draft WhatWG loader spec is pending alpha release on the 1.0 branch.
- Provides an asynchronous loader (
System.import
) to dynamically load ES6 modules. - Supports Traceur, Babel and TypeScript for compiling ES6 modules and syntax into ES5 in the browser with source map support.
- Fully supports ES6 circular references and live bindings.
- Includes paths implementation.
- Can be used as a tracing tool for static analysis of modules.
- Supports IE8+, with IE9+ support for ES6 development without pre-compilation.
- The minified production loader is under 5KB minified and gzipped, making it suitable for production use, provided that modules are built into ES5 making them independent of Traceur.
- Supports declaring modules with
<script type="module">
, the precursor of the proposed<module>
tag.
For an overview of build workflows, see the production guide.
For an example of a universal module loader based on this polyfill for loading AMD, CommonJS and globals, see SystemJS.
Documentation