forked from OtterMind/Chat2DB
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.umirc.ts
More file actions
125 lines (120 loc) · 3.21 KB
/
Copy path.umirc.ts
File metadata and controls
125 lines (120 loc) · 3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
import { defineConfig } from 'umi';
import { extractYarnConfig, transitionTimezoneTimestamp } from './src/utils/webpack';
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
// yarn run build --app_port=xx 获取打包时命令行传入的参数
const yarn_config = extractYarnConfig(process.argv);
const chainWebpack = (config: any, { webpack }: any) => {
config.plugin('monaco-editor').use(MonacoWebpackPlugin, [
{
languages: ['mysql', 'pgsql', 'sql'],
},
]);
};
export default defineConfig({
title: 'Chat2DB',
base: '/',
publicPath: '/',
hash: true,
routes: [
{
path: '/',
component: '@/layouts/GlobalLayout',
routes: [
{
path: '/login',
component: '@/pages/login',
},
{
path: '/demo',
component: '@/pages/demo',
},
{
path: '/connections',
component: 'main',
},
{
path: '/dashboard',
component: 'main',
},
{
path: '/team',
component: 'main',
},
{
path: '/workspace',
component: 'main',
},
{
path: '/',
component: 'main',
},
],
},
],
npmClient: 'yarn',
dva: {},
plugins: ['@umijs/plugins/dist/dva'],
chainWebpack,
proxy: {
'/api': {
target: 'http://127.0.0.1:10821',
changeOrigin: true,
},
'/client/remaininguses/': {
target: 'http://127.0.0.1:1889',
changeOrigin: true,
},
},
targets: {
chrome: 80,
},
// links: [{
// rel: 'manifest',
// href: 'manifest.json',
// }],
links: [{ rel: 'icon', type: 'image/ico', sizes: '32x32', href: '/static/front/logo.ico' }],
headScripts: [
`if (localStorage.getItem('app-local-storage-versions') !== 'v4') {
localStorage.clear();
localStorage.setItem('app-local-storage-versions', 'v4');
}`,
// `if (window.electronApi) { window.electronApi.startServerForSpawn() }`,
// `if ("serviceWorker" in navigator) {
// window.addEventListener("load", function () {
// navigator.serviceWorker
// .register("sw.js")
// .then(res => console.log("service worker registered"))
// .catch(err => console.log("service worker not registered", err));
// })
// }`,
// `var deferredPrompt = null;
// window.addEventListener("beforeinstallprompt", e => {
// e.preventDefault();
// deferredPrompt = e;
// });
// window.addEventListener("appinstalled", () => {
// deferredPrompt = null;
// })`,
{
src: 'https://www.googletagmanager.com/gtag/js?id=G-V8M4E5SF61',
async: true,
},
// `window.dataLayer = window.dataLayer || [];
// function gtag() {
// window.dataLayer.push(arguments);
// }
// gtag('js', new Date());
// gtag('config', 'G-V8M4E5SF61', {
// platform: 'WEB',
// version: '1.0.0'
// });`,
],
favicons: ['logo.ico'],
define: {
__ENV__: process.env.UMI_ENV,
__BUILD_TIME__: transitionTimezoneTimestamp(new Date().getTime()),
__APP_VERSION__: yarn_config.app_version || '0.0.0',
__APP_PORT__: yarn_config.app_port,
},
esbuildMinifyIIFE: true,
});