30 lines
610 B
TypeScript
Executable File
30 lines
610 B
TypeScript
Executable File
import { defineConfig, loadEnv } from "vite";
|
|
import vue from "@vitejs/plugin-vue";
|
|
import path from "path";
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
const env = loadEnv(mode, process.cwd(), "")
|
|
const apiPort = Number(env.VITE_API_PORT) || 3300
|
|
|
|
return {
|
|
plugins: [vue()],
|
|
server: {
|
|
hmr: {
|
|
clientPort: 5173,
|
|
protocol: "ws",
|
|
},
|
|
proxy: {
|
|
"/api": {
|
|
target: `http://localhost:${apiPort}`,
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "src"),
|
|
},
|
|
},
|
|
}
|
|
})
|