mirror of
https://github.com/KwiTsukasa/kt-template-online-web.git
synced 2026-05-27 16:35:47 +08:00
28 lines
626 B
TypeScript
28 lines
626 B
TypeScript
import { defineConfig, loadEnv } from "vite";
|
|
import vue from "@vitejs/plugin-vue";
|
|
import { resolve } from "path";
|
|
import UnoCSS from "unocss/vite";
|
|
|
|
export default ({ mode }) => {
|
|
const VITE_APP_PROXY: string = loadEnv(mode, process.cwd()).VITE_APP_PROXY;
|
|
|
|
return defineConfig({
|
|
plugins: [vue(), UnoCSS()],
|
|
server: {
|
|
port: 48089,
|
|
proxy: {
|
|
"/api": {
|
|
target: VITE_APP_PROXY,
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/api/, ""),
|
|
},
|
|
},
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@": resolve(__dirname, "src"),
|
|
},
|
|
},
|
|
});
|
|
};
|