npm.io
0.63.1 • Published 1 month ago

@startupjs/babel-plugin-import-to-react-lazy

Licence
MIT
Version
0.63.1
Deps
3
Size
4 kB
Vulns
0
Weekly
0
Stars
109

@startupjs/babel-plugin-import-to-react-lazy

Transforms exported default import to React.lazy dynamic import.

Example

/* @asyncImports */
export { default as PHome } from './PHome'

↓ ↓ ↓ ↓ ↓ ↓

import { lazy } from 'react'
export const PHome = lazy(() => import('./PHome'))

License

MIT

Keywords