ant design pro 项目实现路由级的动态加载按需加载
实现路由级的动态加载(code splitting),可按需指定哪一级的按需加载。
配置项包含:
- webpackChunkName,是否通过 webpackChunkName - 实现有意义的异步文件名
- loadingComponent,指定加载时的组件路径
- level,指定按需加载的路由等级
export default {
plugins: [
dynamicImport: {
loadingComponent: './components/PageLoading/index',
webpackChunkName: true,
level: 3,
},
],
};