A dynamic import() polyfill
npm install import.js - [x] compatible with native ES2015 modules
- [x] compatible with native import ... from ...
- [x] compatible with common native export ... expressions
- [x] compatible with Babel transpiled ES2015 modules
- [x] compatible with relative paths
- [x] compatible with absolute paths
``html`
async
src="import.js"
data-main="js/main.js"
>
* the src should point to import.js or its min.js versiondata-main
* the should point to your module entry pointdeferred
* feel free to use or not or async to delay executionXHR
* all modules will be loaded through to avoid the need of a fetch polyfill
* however, you can add any polyfill you need upfront
Use https://unpkg.com/import.js@latest` as source if you'd like to use a CDN service.
Live test based on this folder.
You can test native ES2015 module export too. It requires a compatible browser (today any modern WebKit would do).