123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- // https://umijs.org/config/
- import { defineConfig } from 'umi'
- import defaultSettings from './defaultSettings'
- import proxy from './proxy'
- import routes from './routes'
- import WindiCSSPlugin from 'windicss-webpack-plugin'
- const { REACT_APP_ENV } = process.env
- export default defineConfig({
- hash: true,
- antd: {},
- dva: {
- hmr: true
- },
- layout: {
- // https://umijs.org/zh-CN/plugins/plugin-layout
- locale: true,
- siderWidth: 208,
- ...defaultSettings
- },
- // https://umijs.org/zh-CN/plugins/plugin-locale
- locale: {
- // default zh-CN
- default: 'zh-CN',
- antd: true,
- // default true, when it is true, will use `navigator.language` overwrite default
- baseNavigator: true
- },
- dynamicImport: {
- loading: '@ant-design/pro-layout/es/PageLoading'
- },
- targets: {
- ie: 11
- },
- // request: { dataField: 'data' },
- // umi routes: https://umijs.org/docs/routing
- routes,
- // Theme for antd: https://ant.design/docs/react/customize-theme-cn
- theme: {
- 'primary-color': defaultSettings.primaryColor
- },
- // esbuild is father build tools
- // https://umijs.org/plugins/plugin-esbuild
- esbuild: {},
- title: false,
- ignoreMomentLocale: true,
- proxy: proxy[REACT_APP_ENV || 'dev'],
- manifest: {
- basePath: '/'
- },
- chainWebpack(config) {
- config.plugin('windicss').use(WindiCSSPlugin)
- },
- extraBabelPlugins: [
- [
- 'import',
- {
- libraryName: '@icon-park/react',
- libraryDirectory: 'es/icons',
- camel2DashComponentName: false
- }
- ]
- ],
- // Fast Refresh 热更新
- fastRefresh: {}
- })
|