-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
44 lines (43 loc) · 1.21 KB
/
vite.config.ts
File metadata and controls
44 lines (43 loc) · 1.21 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
33
34
35
36
37
38
39
40
41
42
43
44
import react from "@vitejs/plugin-react";
import path from "path";
import { defineConfig } from "vite";
// https://vite.dev/config/
export default defineConfig(() => ({
plugins: [react()],
build: {
minify: false,
// Disable inline source maps in production to keep asset sizes small
sourcemap: false,
rollupOptions: {
output: {
sourcemapExcludeSources: false, // Include original source in source maps if sourcemaps are enabled
},
},
},
// Enable source maps in development too
css: {
devSourcemap: true,
},
server: {
allowedHosts: ["*"],
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
"@shared": path.resolve(__dirname, "./shared"),
},
},
optimizeDeps: {
// This is still crucial for reducing the time from when `bun run dev`
// is executed to when the server is actually ready.
include: ["react", "react-dom", "react-router-dom"],
exclude: ["agents"], // Exclude agents package from pre-bundling due to Node.js dependencies
force: true,
},
define: {
// Define Node.js globals for the agents package
global: "globalThis",
},
// Clear cache more aggressively
cacheDir: "node_modules/.vite",
}));