WebReflection / Import.js
Licence: isc
A dynamic import() polyfill
Stars: ✭ 93
Programming Languages
javascript
184084 projects - #8 most used programming language
import.js
A dynamic import() polyfill.
Don't miss the related blog post.
Features
- [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
Usage
<!doctype html>
<!-- literally anything you need before -->
<script
async
src="import.js"
data-main="js/main.js"
></script>
- the
src
should point toimport.js
or itsmin.js
version - the
data-main
should point to your module entry point - feel free to use or not
deferred
orasync
to delay execution - all modules will be loaded through
XHR
to avoid the need of afetch
polyfill - however, you can add any polyfill you need upfront
Use https://unpkg.com/[email protected]
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).
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].