-
Notifications
You must be signed in to change notification settings - Fork 250
Expand file tree
/
Copy pathvite.config.ts
More file actions
32 lines (31 loc) · 1.09 KB
/
Copy pathvite.config.ts
File metadata and controls
32 lines (31 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { reactRouter } from "@react-router/dev/vite";
import tailwindcss from "@tailwindcss/vite";
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
export default defineConfig({
plugins: [tailwindcss(), reactRouter(), tsconfigPaths()],
// Force a single instance of React/React-DOM. Without dedupe, Radix UI's peer dependency on
// React can lead Vite's optimizer to ship two copies (each with its own dispatcher), which
// surfaces as "Invalid hook call" / "Cannot read properties of null (reading 'useMemo')" the
// first time a route loads a Radix component such as <Select>.
resolve: {
dedupe: ["react", "react-dom"],
},
optimizeDeps: {
include: ["react", "react-dom", "react-dom/client"],
},
server: {
proxy: {
"/backend": {
target: "http://localhost:3000",
changeOrigin: true,
rewrite: (path) => path.replace(/^\/backend/, ""),
},
"/renderer": {
target: "http://localhost:8000",
changeOrigin: true,
rewrite: (path) => path.replace(/^\/renderer/, ""),
},
},
},
});