babel-plugin-dynamic-import-system-import

Babel plugin to transpile import() to System.import()

Usage no npm install needed!

<script type="module">
  import babelPluginDynamicImportSystemImport from 'https://cdn.skypack.dev/babel-plugin-dynamic-import-system-import';
</script>

README

babel-plugin-dynamic-import-system-import

Babel plugin to transpile import() to System.import().

NOTE: Babylon >= v6.12.0 is required to correct parse dynamic imports.

Installation

$ npm install babel-plugin-dynamic-import-system-import --save-dev

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["dynamic-import-system-import"]
}

Via CLI

$ babel --plugins dynamic-import-system-import script.js

Via Node API

require('babel-core').transform('code', {
  plugins: ['dynamic-import-system-import']
});