@masknet/prefer-defer-import
Prefer defer import a module. See https://github.com/tc39/proposal-defer-import-eval and https://github.com/webpack/webpack/pull/16567/.
/**
* @minItems Infinity
*/
export type Options = [
| {
/**
* @minItems 0
*/
deferPackages?: string[]
syntax?: 'webpack-magic-comment'
}
| {
/**
* @minItems 0
*/
eagerPackages?: string[]
syntax?: 'webpack-magic-comment'
},
]
import { foo } from 'bar'
foo
import * as foo from /* webpackDefer: true */ 'bar'
foo.foo