How can I add Environment Variables in Vite React Project in the vite.config.js file
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
const proxy_url = "localhost/";
export default defineConfig({
plugins: [react()],
server: {
proxy: {
"/api": {
target: proxy_url,
changeOrigin: true,
rewrite: (path) => path.replace(/^/api/, ""),
},
},
},
});
How can I add Environment Variables in Vite React Project in the vite.config.js file
import { defineConfig } from "vite"; import react from "@vitejs/plugin-react";
const proxy_url = "localhost/";
export default defineConfig({ plugins: [react()], server: { proxy: { "/api": { target: proxy_url, changeOrigin: true, rewrite: (path) => path.replace(/^/api/, ""), }, }, }, });