|
- // https://umijs.org/config/
- import { defineConfig } from 'umi';
- import { join } from 'path';
-
- import defaultSettings from './defaultSettings';
- import proxy from './proxy';
- import routes from './routes';
-
- const { REACT_APP_ENV } = process.env;
-
- const baseURL = REACT_APP_ENV == 'page' ? '/PaddleLabel-Frontend/' : '/static/';
-
- export default defineConfig({
- hash: true,
- history: { type: 'hash' },
- 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: 'en-US',
- 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,
- },
- // umi routes: https://umijs.org/docs/routing
- routes,
- // Theme for antd: https://ant.design/docs/react/customize-theme-cn
- theme: {
- 'root-entry-name': 'variable',
- 'primary-color': '#1727C2', // Global Main color
- 'primary-color-hover': '#515EED',
- 'link-color': '#2e3dc8',
- 'success-color': '#73c300',
- 'warning-color': '#f1a200',
- 'error-color': '#cf3f00',
- 'text-color': '#333333',
- 'disabled-color': '#cccccc',
- 'border-radius-base': '0rem',
- },
- // esbuild is father build tools
- // https://umijs.org/plugins/plugin-esbuild
- esbuild: {},
- title: false,
- ignoreMomentLocale: true,
- proxy: proxy[REACT_APP_ENV || 'dev'],
- manifest: {
- basePath: baseURL,
- },
- base: baseURL,
- publicPath: baseURL,
- // Fast Refresh
- fastRefresh: {},
- nodeModulesTransform: { type: 'none' },
- mfsu: {},
- webpack5: {},
- exportStatic: {},
- });
|