Update Vite configuration to deduplicate React and React-DOM; enhance DeviceContext with syncPeqCatalog method for improved PEQ state management; refactor LuxsinAPI to streamline PEQ filter updates; replace range input with ThumbOnlyRangeSlider in Home component for better user experience.
This commit is contained in:
+4
-30
@@ -183,6 +183,7 @@ export default defineConfig({
|
||||
"@shared": path.resolve(import.meta.dirname, "shared"),
|
||||
"@assets": path.resolve(import.meta.dirname, "attached_assets"),
|
||||
},
|
||||
dedupe: ["react", "react-dom"],
|
||||
},
|
||||
envDir: path.resolve(import.meta.dirname),
|
||||
root: path.resolve(import.meta.dirname, "client"),
|
||||
@@ -207,36 +208,9 @@ export default defineConfig({
|
||||
output: {
|
||||
manualChunks(id) {
|
||||
if (!id.includes("node_modules")) return;
|
||||
|
||||
if (id.includes("node_modules/react/") || id.includes("node_modules/react-dom/")) {
|
||||
return "react-vendor";
|
||||
}
|
||||
if (id.includes("node_modules/wouter/")) {
|
||||
return "router-vendor";
|
||||
}
|
||||
if (id.includes("node_modules/echarts/")) return "echarts-vendor";
|
||||
if (id.includes("node_modules/recharts/")) return "recharts-vendor";
|
||||
if (id.includes("node_modules/framer-motion/")) return "motion-vendor";
|
||||
if (id.includes("node_modules/@radix-ui/")) return "radix-vendor";
|
||||
|
||||
// streamdown + shiki + mermaid (lazy-loaded with AIPage)
|
||||
if (
|
||||
id.includes("streamdown") ||
|
||||
id.includes("@shikijs/") ||
|
||||
id.includes("/shiki/") ||
|
||||
id.includes("mermaid")
|
||||
) {
|
||||
return "ai-markdown-vendor";
|
||||
}
|
||||
|
||||
if (
|
||||
id.includes("node_modules/lucide-react/") ||
|
||||
id.includes("node_modules/class-variance-authority/") ||
|
||||
id.includes("node_modules/clsx/") ||
|
||||
id.includes("node_modules/tailwind-merge/")
|
||||
) {
|
||||
return "ui-vendor";
|
||||
}
|
||||
// Only split echarts (lazy EQ page). Do not manually chunk react, radix, lucide,
|
||||
// or ai-markdown — forced splits hoist shared helpers and break React.forwardRef.
|
||||
if (id.includes("/echarts/")) return "echarts-vendor";
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user