-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathvite.config.ts
36 lines (33 loc) · 980 Bytes
/
vite.config.ts
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
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import monacoEditorPluginModule from 'vite-plugin-monaco-editor';
const isObjectWithDefaultFunction = (module: unknown): module is { default: typeof monacoEditorPluginModule } => (
module != null &&
typeof module === 'object' &&
'default' in module &&
typeof module.default === 'function'
)
const monacoEditorPlugin = isObjectWithDefaultFunction(monacoEditorPluginModule)
? monacoEditorPluginModule.default
: monacoEditorPluginModule
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), monacoEditorPlugin({ languageWorkers: ['typescript'] })],
base: "",
define: {
'__APP_VERSION__': JSON.stringify(process.env.npm_package_version),
},
server: {
host: "0.0.0.0",
port: 1001,
proxy: {
'/api': {
target: "http://127.0.0.1:8080"
},
'/ws': {
target: 'ws://127.0.0.1:8080',
ws: true,
},
}
}
})