You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
614 B
25 lines
614 B
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import { resolve } from 'path' //
|
|
|
|
export default defineConfig({
|
|
plugins: [vue()], //
|
|
server: {
|
|
host: '192.168.1.102',
|
|
port: 5173,
|
|
// 错误1:server 块内不能嵌套 plugins 配置(已删除)
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://192.168.99.223:3000',
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/api/, '')
|
|
}
|
|
}
|
|
},
|
|
resolve: { //
|
|
alias: {
|
|
"/@": resolve(__dirname, "src"), //
|
|
}
|
|
},
|
|
base: process.env.NODE_ENV === "production" ? "./" : "/",
|
|
})
|