首页 > 其他分享 >vue3+vite build打包报错:Some chunks are larger than 500 KiB after minification. Consider:

vue3+vite build打包报错:Some chunks are larger than 500 KiB after minification. Consider:

时间:2022-12-28 23:12:40浏览次数:63  
标签:Consider chunk after 报错 location document vite build

看官方的解决方案:

1、在rollup配置文件中添加output.manualChunks,将模块拆分成多个chunk,减小每个chunk的大小;

2、build.chunkSizeWarningLimit,提高报错的阈值;
3、使用动态import()进行代码分割,减小每个chunk的大小。

我的解决方案,直接在vite.config.js配置build即可:

 

TRANSLATE with x English
Arabic Hebrew Polish
Bulgarian Hindi Portuguese
Catalan Hmong Daw Romanian
Chinese Simplified Hungarian Russian
Chinese Traditional Indonesian Slovak
Czech Italian Slovenian
Danish Japanese Spanish
Dutch Klingon Swedish
English Korean Thai
Estonian Latvian Turkish
Finnish Lithuanian Ukrainian
French Malay Urdu
German Maltese Vietnamese
Greek Norwegian Welsh
Haitian Creole Persian  
  TRANSLATE with COPY THE URL BELOW Back EMBED THE SNIPPET BELOW IN YOUR SITE Enable collaborative features and customize widget: Bing Webmaster Portal Back

标签:Consider,chunk,after,报错,location,document,vite,build
From: https://www.cnblogs.com/Blod/p/17011482.html

相关文章