Enable autoCodeSplitting in TanStackRouterVite plugin to split the monolithic 582 KB bundle into route-level chunks. Main vendor chunk drops to 454 KB with initiative detail (~13 KB), inbox (~13 KB), and dashboard (~65 KB) as separate lazy-loaded chunks. Eliminates the Vite 500 KB chunk size warning.
22 lines
497 B
TypeScript
22 lines
497 B
TypeScript
import path from "node:path";
|
|
import { defineConfig } from "vite";
|
|
import { TanStackRouterVite } from "@tanstack/router-plugin/vite";
|
|
import react from "@vitejs/plugin-react";
|
|
|
|
export default defineConfig({
|
|
plugins: [TanStackRouterVite({ autoCodeSplitting: true }), react()],
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
},
|
|
},
|
|
server: {
|
|
proxy: {
|
|
"/trpc": {
|
|
target: "http://127.0.0.1:3847",
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
});
|