Babel plugin to transpile import() to a deferred require(), for node
npm install babel-plugin-transform-dynamic-importBabel plugin to transpile import() to a deferred require(), for node. Matches the proposed spec.
NOTE: Babylon >= v6.12.0 is required to correct parse dynamic imports.
``sh`
$ npm install babel-plugin-transform-dynamic-import --save-dev
.babelrc
`json`
{
"plugins": ["transform-dynamic-import"]
}
`sh`
$ babel --plugins transform-dynamic-import script.js
`javascript``
require('@babel/core').transform('code', {
plugins: ['transform-dynamic-import']
});