Browse Source

对配置的更改

hxl
Administrator 4 weeks ago
parent
commit
156178f8d1
  1. 25
      vite.config.js

25
vite.config.js

@ -1,12 +1,25 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path' //
// https://vite.dev/config/
export default defineConfig({
plugins: [vue()],
plugins: [vue()], //
server: {
host: '192.168.1.102', // 监听所有 IP
port: 5173 // 指定端口(可选)
}
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" ? "./" : "/",
})
Loading…
Cancel
Save