Skip larger chunks to run "Npm run build"
P粉381463780
2023-08-24 13:54:24
<p>I encountered this problem while trying to run "<code>npm run build</code>"</p>
<pre class="brush:php;toolbar:false;">(!) Some blocks are larger than 500 KiB after minification. Please consider:
- Use dynamic import() to code split your application
- Use build.rollupOptions.output.manualChunks to improve chunk splitting: https://rollupjs.org/guide/en/#outputmanualchunks
- Adjust the chunk size limit for this warning via build.chunkSizeWarningLimit. </pre>
<p><br /></p>
EDIT: Here is a workaround, just hide the warning
Add command in vite.config.js
Complete code
If you don't want to increase
chunkSizeWarningLimit
and are more concerned with solving the actual size problem, try the following solutions: