-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.dev.ts
More file actions
52 lines (48 loc) · 1.23 KB
/
vite.config.dev.ts
File metadata and controls
52 lines (48 loc) · 1.23 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
import { defineConfig } from 'vite'
import monacoEditorPlugin from 'vite-plugin-monaco-editor'
import dotenv from 'dotenv'
dotenv.config()
const vitePort = parseInt(process.env.PORT || '3000') - 1
const apiPort = vitePort + 1
const hmrPort = vitePort + 2
const localPath = `http://localhost:${apiPort}`
export default defineConfig({
root: './client',
mode: 'development',
server: {
port: vitePort,
strictPort: true,
proxy: {
'/me': localPath,
'/auth': localPath,
'/api': localPath,
},
hmr: {
port: hmrPort,
protocol: 'ws',
host: 'localhost',
}
},
build: {
outDir: '../dist/client',
emptyOutDir: true,
assetsDir: 'static',
rollupOptions: {
treeshake: true,
output: {
chunkFileNames: 'static/[name].js',
entryFileNames: 'static/[name].js',
assetFileNames: 'static/[name][extname]',
},
}
},
plugins: [monacoEditorPlugin({
languageWorkers: [
'css',
'html',
'json',
'typescript',
'editorWorkerService',
]
})],
})