-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Full explanation and background in original, ViteJS issue.
Long story short, when there is a bigger bundle, in my case, a design system monorepo that contains ~2600 icons (each as a React component, referenced in an index file that Maps them as ['name', () => import('../component/name')], rollup build takes in my case 46 minutes (while ParcelJS is much faster, ~30 seconds).
I tried to debug it and it seems like rollup graphs dependencies in a way that it creates loop iteration for each file and within that iteration it iterates over every files in a bundle, which seems to me like O(n^2) performance.
I've made a repro repo to demo the problem. You can compare there ViteJS that uses Rollup and Parceljs (that uses custom bundler I believe).
Also for reference, my findings in a ViteJS discussion thread.
Line 165 in 27c0557
| private async generateModuleGraph(): Promise<void> { |
I believe this is worth looking, even though it's not that common problem because not many people have this big marketing iconography in their repos ;)