tsfile-viewer-web-frontend/config/config.js (106 lines of code) (raw):

/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // https://umijs.org/config/ import { defineConfig } from 'umi'; import { join } from 'path'; import defaultSettings from './defaultSettings'; import proxy from './proxy'; 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, }, // umi routes: https://umijs.org/docs/routing routes: [ { path: '/', component: 'Welcome' }, { path: '/tsfile-tool/v2/', name: 'tsfile-tool', icon: 'FileOutlined', component: './tsfile-tool/v2', }, { name: 'exception', icon: 'warning', path: '/exception', hideInMenu: true, routes: [ { name: '403', icon: 'smile', path: '/exception/403', component: './exception/403', }, { name: '404', icon: 'smile', path: '/exception/404', component: './exception/404', }, { name: '500', icon: 'smile', path: '/exception/500', component: './exception/500', }, ], }, { component: '404', }, ], // 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'], proxy: { '/api': { // 标识需要进行转换的请求的url "target": "http://localhost:8080/api/", // 服务端域名 "changeOrigin": true, // 允许域名进行转换 "pathRewrite": { "^/api": ''} // 将请求url里的ci去掉 }, }, manifest: { basePath: '/', }, // Fast Refresh 热更新 fastRefresh: {}, openAPI: [ { requestLibPath: "import { request } from 'umi'", // 或者使用在线的版本 // schemaPath: "https://gw.alipayobjects.com/os/antfincdn/M%24jrzTTYJN/oneapi.json" schemaPath: join(__dirname, 'oneapi.json'), projectName: 'ant-design-pro', mock: false, }, // { // requestLibPath: "import { request } from 'umi'", // schemaPath: 'https://gw.alipayobjects.com/os/antfincdn/CA1dOm%2631B/openapi.json', // projectName: 'swagger', // }, { requestLibPath: "import { request } from 'umi'", // schemaPath: join(__dirname, 'swagger.json'), schemaPath: 'http://localhost:8080/v2/api-docs', projectName: 'swagger1', mock: false, }, // { // requestLibPath: "import { request } from 'umi'", // // schemaPath: join(__dirname, 'swagger.json'), // schemaPath: 'http://localhost:8081/api/spec', // projectName: 'swagger2', // mock: false, // }, ], nodeModulesTransform: { type: 'none', }, // mfsu: {}, webpack5: {}, exportStatic: {}, history: { type: 'hash' }, });