当前位置:网站首页>Applet: uniapp solves vendor JS is too large

Applet: uniapp solves vendor JS is too large

2022-06-26 15:11:00 [email protected]

One 、 Introduction to the environment

uniapp + HBuilderX

Two 、 Problem description

Real machine debugging , Prompt package submitted too large , Cannot generate QR code , It is impossible to upload the code later

 

3、 ... and 、 Code package volume optimization

Code package volume optimization | Wechat open documents

3.1、 Static resources such as pictures are put on the server , The applet references the server file address ( More pictures will save a lot of volume ).
The project only retains the bottom navigation icon.

3.2、 Subcontracting is performed according to the business type ( The volume of a single package decreases rapidly after subcontracting ):

Use subcontracting | Wechat open documents

"optimization":{
    "subPackages":true
}

3.3、 Run time compression code ( The volume is reduced a lot , Test items are reduced 400 many kb)

 

Before compression :

  After these steps, the code volume has reached :

Less than 2M, Code can already generate QR code preview 、 debugging 、 Upload the  

3.4、 Check these :

3.5、 After checking this box, it will be passed :

manifest.json Configure on demand injection :

"lazyCodeLoading": "requiredComponents"

After configuration, it passes  

 

3.6、 One important point , Clean up useless code in time  

Four 、 Welcome to communicate and correct , Pay attention to me , Learning together  

5、 ... and 、 Reference link :

solve vendor.js Too big a problem _ LV Xiaoxian's Baba blog -CSDN Blog _vendor.js Too big

Vue Package optimization ( solve vendor.js Too big a problem )_ Huanghe ailang's blog -CSDN Blog _vendor.js

Vue Package optimization ( solve vendor.js Too big a problem )_ Huanghe ailang's blog -CSDN Blog _vendor.js

https://www.jb51.net/article/164542.htm

uni-app project vendor.js Too big to handle - Simple books

uniapp How to subcontract an applet ? Complete and detailed steps to teach you _ Mu Qing ゚ The blog of -CSDN Blog _uniapp to subcontract

solve uni-app After compiling vendor.js File is too large.

How to solve uni-app After compiling  vendor.js  File is too large. / Sheng Rong Zhang

Applet performance optimization guide | Wechat open community  

uniapp Applets enable component on-demand injection “lazyCodeLoading“: “requiredComponents“_ A kilogram of code blog -CSDN Blog

On demand injection and time-consuming injection | Wechat open documents  

原网站

版权声明
本文为[[email protected]]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/177/202206261451357726.html