You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 13, 2020. It is now read-only.
Fetches module sources in the browser, then uses Babel to transform them into System.register modules.
The loader polyfill then handles the loading and execution pipeline as in the loader spec.
This project is only suitable for demonstrations / experimentation and is not designed for any production workflows at all.
Installation
npm install browser-es-module-loader
Usage
<scriptsrc="dist/babel-browser-build.js"></script><scriptsrc="dist/browser-es-module-loader.js"></script><!-- script type=module loading --><scripttype="module" src="path/to/module.js"></script><!-- Anonymous script type module loading --><scripttype="module">import{x}from'./y.js';// this case throws as plain / bare names are not supported as in the WhatWG specimportthisWillThrowfrom'x';// dynamic import also supportedimport('./x').then(function(m){// ...});</script><!-- dynamic loader instantiation also supported --><script>varloader=newBrowserESModuleLoader();// relative path or URL syntax is necessary as plain resolution throwsloader.import('./path/to/file.js').then(function(m){// ...});</script>