File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments