forked from pig-mesh/pig-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
executable file
·37 lines (36 loc) · 1.09 KB
/
vite.config.js
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
import {defineConfig, loadEnv} from 'vite'
import createVitePlugins from './vite/plugins'
const {resolve} = require('path')
export default defineConfig(({mode, command}) => {
const env = loadEnv(mode, process.cwd())
return {
build: {
commonjsOptions: {
transformMixedEsModules: true,
include: [],
},
},
optimizeDeps: {
disabled: false,
},
server: {
port: 8080,
proxy: {
'/api': {
target: 'http://pig-gateway:9999',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '')
}
}
},
resolve: {
alias: {
"@": resolve(__dirname, "./src"),
"components": resolve(__dirname, "./src/components"),
"styles": resolve(__dirname, "./src/styles"),
"utils": resolve(__dirname, "./src/utils"),
}
},
plugins: createVitePlugins(env, command === 'build')
}
})