uniapp packs WeChat applets, the package is too large to solve

The size of each subpackage of the WeChat applet is 2M, and the total volume cannot exceed 20M.

The size of each subpackage of the Byte applet is 2M, and the total volume cannot exceed 16M (Byte applet basic library version 1.88.0 and above supports it, and the Byte applet developer tool should be versions less than 3.0.0).

1. Use subpackages subPackages

  • "optimization":{"subPackages":true}Add and enable subpackage optimization under the configuration of the corresponding platform
  • Currently only supports subpackage optimization of mp-weixin, mp-qq, mp-baidu, mp-toutiao,mp-kuaishou
//mainfest.json 
"mp-weixin" : { 
"appid" : "xxxx", 
"setting" : { 
"urlCheck" : false 
}, 
"usingComponents" : true, 
"permission" : { 
"scope.userLocation" : { 
"desc" : "Your location information will be used to display the effect of the location interface of the applet" 
} 
}, 
"plugins" : {}, 
//The subpackaged js files will not be packaged into the vendor.js of the main package 
"optimization":{"subPackages":true} 
},

2. Optimize vendor.jstoo much

  • HBuilderXCreated items checked运行-->运行到小程序模拟器-->运行时是否压缩代码

Generally, through the above 2 steps, you can basically pass the upload limit of the WeChat applet, but at the same time

Guess you like

Origin blog.csdn.net/u013040757/article/details/129139219