Guest User

Vite Config - @itsPaulAi

a guest
Jun 9th, 2025
678
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import path from "node:path";
  2. import { defineConfig } from "vite";
  3. import react from "@vitejs/plugin-react-swc";
  4. import tailwindcss from "@tailwindcss/vite";
  5.  
  6. // https://vitejs.dev/config/
  7. export default defineConfig({
  8.   plugins: [react(), tailwindcss()],
  9.   base: "/app/",
  10.   resolve: {
  11.     alias: {
  12.       "@": path.resolve(new URL(".", import.meta.url).pathname, "./src"),
  13.     },
  14.   },
  15.   server: {
  16.     // 1. Expose server to all network interfaces
  17.     host: "0.0.0.0",
  18.     proxy: {
  19.       // Proxy API requests to the backend server
  20.       "/api": {
  21.         // 2. Corrected port for the development server
  22.         target: "http://127.0.0.1:2024",
  23.         changeOrigin: true,
  24.       },
  25.     },
  26.     // 3. Allow requests from any Replit preview URL
  27.     allowedHosts: [".replit.dev"],
  28.   },
  29. });
Add Comment
Please, Sign In to add comment