Allow parsing of
lazyImport()
Modules only on demand.
npm install babel-plugin-syntax-dynamic-lazy-import --save-dev
Via .babelrc
or babel-loader.
{
"plugins": ["syntax-lazy-import"]
}
Converts
const component = lazyImport('./xx.js')
to
const component = () => import('./xx.js')