代码拉取完成,页面将自动刷新
// https://umijs.org/config/
import { resolve } from 'path'
import { i18n } from './src/utils/config'
export default {
ignoreMomentLocale: true,
targets: { ie: 9 },
treeShaking: true,
plugins: [
[
// https://umijs.org/plugin/umi-plugin-react.html
'umi-plugin-react',
{
dva: { immer: true },
antd: true,
dynamicImport: {
webpackChunkName: true,
loadingComponent: './components/Loader/Loader',
},
routes: {
exclude: [
/model\.(j|t)sx?$/,
/service\.(j|t)sx?$/,
/models\//,
/components\//,
/services\//,
/chart\/Container\.js$/,
/chart\/ECharts\/.+Component\.js$/,
/chart\/ECharts\/.+ComPonent\.js$/,
/chart\/ECharts\/theme\/.+\.js$/,
/chart\/highCharts\/.+Component\.js$/,
/chart\/highCharts\/mapdata\/.+\.js$/,
/chart\/Recharts\/.+Component\.js$/,
/chart\/Recharts\/Container\.js$/,
],
update: routes => {
if (!i18n) return routes
const newRoutes = []
for (const item of routes[0].routes) {
newRoutes.push(item)
if (item.path) {
newRoutes.push(
Object.assign({}, item, {
path:
`/:lang(${i18n.languages
.map(item => item.key)
.join('|')})` + item.path,
})
)
}
}
routes[0].routes = newRoutes
return routes
},
},
dll: {
include: ['dva', 'dva/router', 'dva/saga', 'dva/fetch', 'antd/es'],
},
pwa: {
manifestOptions: {
srcPath: 'manifest.json'
},
}
},
],
],
// Theme for antd
// https://ant.design/docs/react/customize-theme
theme: './config/theme.config.js',
// Webpack Configuration
proxy: {
'/api/v1/': {
target: 'http://localhost',
changeOrigin: true,
pathRewrite: { '^/api/v1/': '' },
}
},
alias: {
api: resolve(__dirname, './src/services/'),
components: resolve(__dirname, './src/components'),
config: resolve(__dirname, './src/utils/config'),
models: resolve(__dirname, './src/models'),
routes: resolve(__dirname, './src/routes'),
services: resolve(__dirname, './src/services'),
themes: resolve(__dirname, './src/themes'),
utils: resolve(__dirname, './src/utils'),
},
extraBabelPresets: ['@lingui/babel-preset-react'],
extraBabelPlugins: [
[
'import',
{
libraryName: 'lodash',
libraryDirectory: '',
camel2DashComponentName: false,
},
'lodash',
],
],
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。