1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- // https://umijs.org/config/
- import { defineConfig } from '@umijs/max';
- import { join } from 'path';
- import defaultSettings from './defaultSettings';
- import proxy from './proxy';
- import routes from './routes';
-
- const { REACT_APP_ENV } = process.env;
-
- export default defineConfig({
- define: {
- API_BASE: REACT_APP_ENV ? '' : ''
- },
- hash: true,
- antd: {
- dark: true,
- },
- request: {},
- initialState: {},
- model: {},
- layout: {
- // https://umijs.org/zh-CN/plugins/plugin-layout
- locale: false,
- siderWidth: 208,
- ...defaultSettings,
- },
- // https://umijs.org/zh-CN/plugins/plugin-locale
- locale: false,
-
- targets: {
- ie: 11,
- },
- // umi routes: https://umijs.org/docs/routing
- routes,
- access: {},
- // Theme for antd: https://ant.design/docs/react/customize-theme-cn
- theme: {
- // 如果不想要 configProvide 动态设置主题需要把这个设置为 default
- // 只有设置为 variable, 才能使用 configProvide 动态设置主色调
- // https://ant.design/docs/react/customize-theme-variable-cn
- 'root-entry-name': 'variable',
- },
- ignoreMomentLocale: true,
- proxy: proxy[REACT_APP_ENV || 'dev'],
- manifest: {
- basePath: '/',
- },
- // Fast Refresh 热更新
- fastRefresh: true,
- presets: ['umi-presets-pro'],
- openAPI: [
- {
- requestLibPath: "import { request } from '@umijs/max'",
- // 或者使用在线的版本
- // schemaPath: "https://gw.alipayobjects.com/os/antfincdn/M%24jrzTTYJN/oneapi.json"
- schemaPath: join(__dirname, 'oneapi.json'),
- mock: false,
- },
- {
- requestLibPath: "import { request } from '@umijs/max'",
- schemaPath: 'https://gw.alipayobjects.com/os/antfincdn/CA1dOm%2631B/openapi.json',
- projectName: 'swagger',
- },
- ],
- });
|