-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Description
Description
I have a React app that uses Vite and MUI Data Grid. Latest version of Data Grid has an MUI fork of exceljs as a dependency that is distributed as a single minified JS file. Vite does the right thing and creates a chunk for this file, but this file alone is 1035.45 kB in the version I'm using. This of course triggers the build warning that says:
(!) Some chunks are larger than 500 kB after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
Dynamic imports and manualChunks won't help here as we're talking of a single huge minified JS file. I don't want to increase chunkSizeWarningLimit because I want to make sure all my other chunks are small and under 500 kB.
Suggested solution
Vite should provide some build configuration option like ignoreChunkSize: ["exceljs.min.js"] so that it would let that chunk be bigger than 500 kB but still check the size of my other chunks.
Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.