From 821610b3f94dfd212752ce131ca1cac8ac83d23b Mon Sep 17 00:00:00 2001 From: Ben Halverson Date: Tue, 28 Oct 2025 01:10:29 -0700 Subject: [PATCH] fix build --- vite.config.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index ae1778a..4c14608 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -22,17 +22,15 @@ export default defineConfig({ rollupOptions: { output: { manualChunks: (id) => { - // Only bundle Three.js when PreviewComponent is loaded - if (id.includes('node_modules/three/')) { - return 'three-core'; - } - if (id.includes('@react-three/')) { - return 'react-three'; - } // Separate vendor chunks for better caching if (id.includes('node_modules/react') || id.includes('node_modules/react-dom') || id.includes('node_modules/react-router')) { return 'react-vendor'; } + // Keep Three.js separate but don't split @react-three packages + // They need to stay with the component that uses them to avoid dependency issues + if (id.includes('node_modules/three/') && !id.includes('@react-three')) { + return 'three-core'; + } if (id.includes('@headlessui') || id.includes('@heroicons') || id.includes('react-hot-toast')) { return 'ui-vendor'; }