Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR addresses build issues by modifying the chunk splitting strategy in Vite configuration. The changes prevent dependency issues by keeping @react-three packages bundled with their consuming components rather than in a separate chunk.
Key Changes:
- Removed separate chunking for
@react-threepackages - Modified Three.js chunking logic to exclude
@react-threepackages - Reordered chunk detection logic to prioritize vendor chunks
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
| // 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')) { |
There was a problem hiding this comment.
The condition !id.includes('@react-three') will incorrectly exclude paths like node_modules/three/examples/jsm/... if they happen to contain the string '@react-three' anywhere in the full path (e.g., in a parent directory name). Use a more precise check like !id.includes('node_modules/@react-three') to ensure you're only excluding the @react-three packages and not legitimate three.js files.
| if (id.includes('node_modules/three/') && !id.includes('@react-three')) { | |
| if (id.includes('node_modules/three/') && !id.includes('node_modules/@react-three')) { |
No description provided.