diff --git a/config/config.js b/config/config.js index fab44a84..b73a21df 100644 --- a/config/config.js +++ b/config/config.js @@ -19,7 +19,9 @@ export default { default: 'zh-CN', // default zh-CN baseNavigator: true, // default true, when it is true, will use `navigator.language` overwrite default }, - dynamicImport: true, + dynamicImport: { + loadingComponent: './components/PageLoading/index', + }, polyfills: ['ie11'], ...(!process.env.TEST && os.platform() === 'darwin' ? { diff --git a/src/components/PageLoading/index.js b/src/components/PageLoading/index.js new file mode 100644 index 00000000..77c0f165 --- /dev/null +++ b/src/components/PageLoading/index.js @@ -0,0 +1,10 @@ +import React from 'react'; +import { Spin } from 'antd'; + +// loading components from code split +// https://umijs.org/plugin/umi-plugin-react.html#dynamicimport +export default () => ( +