-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.ts
46 lines (41 loc) · 937 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
37
38
39
40
41
42
43
44
45
46
import type { UserConfig } from 'vite'
import { resolve } from 'path'
import vue from '@vitejs/plugin-vue'
const pathResolve = (dir: string) => {
return resolve(__dirname, '.', dir)
}
const alias: Record<string, string> = {
'@': pathResolve('src'),
}
const viteConfig: UserConfig = {
root: process.cwd(),
base: './',
alias,
css: {
// sass: {
// includePaths: ['path/to/sass/deps'],
// },
},
optimizeDeps: {
include: ['axios', '@kangc/v-md-editor/lib/theme/vuepress.js'],
},
server: {
port: 9526,
proxy: {
// with options
'/api': {
target: 'http://localhost:3000/web/api/',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
},
'/uploads': {
target: 'http://localhost:3000',
ws: true,
changeOrigin: true
}
},
hmr: { overlay: true }
},
plugins: [vue()],
}
export default viteConfig