Files
docmost-ryan/apps/client/vite.config.ts
2024-07-05 16:25:00 +12:00

32 lines
591 B
TypeScript

import { defineConfig, loadEnv } from "vite";
import react from "@vitejs/plugin-react";
import * as path from "path";
export const envPath = path.resolve(process.cwd(), "..", "..");
export default defineConfig(({ mode }) => {
const { APP_URL } = loadEnv(mode, envPath, "");
return {
define: {
"process.env": {
APP_URL,
},
},
plugins: [react()],
resolve: {
alias: {
"@": "/src",
},
},
server: {
proxy: {
"/api": {
target: APP_URL,
changeOrigin: true,
},
},
},
};
});