Skip to content

Commit f241913

Browse files
authored
fix build (#24)
1 parent b11677c commit f241913

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

vite.config.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,15 @@ export default defineConfig({
2222
rollupOptions: {
2323
output: {
2424
manualChunks: (id) => {
25-
// Only bundle Three.js when PreviewComponent is loaded
26-
if (id.includes('node_modules/three/')) {
27-
return 'three-core';
28-
}
29-
if (id.includes('@react-three/')) {
30-
return 'react-three';
31-
}
3225
// Separate vendor chunks for better caching
3326
if (id.includes('node_modules/react') || id.includes('node_modules/react-dom') || id.includes('node_modules/react-router')) {
3427
return 'react-vendor';
3528
}
29+
// Keep Three.js separate but don't split @react-three packages
30+
// They need to stay with the component that uses them to avoid dependency issues
31+
if (id.includes('node_modules/three/') && !id.includes('@react-three')) {
32+
return 'three-core';
33+
}
3634
if (id.includes('@headlessui') || id.includes('@heroicons') || id.includes('react-hot-toast')) {
3735
return 'ui-vendor';
3836
}

0 commit comments

Comments
 (0)