background introduction:
Wechat limits the code package to no more than 2 MB. The size limit is based on the startup speed of Mini Program. He hopes that users can get a "instant drive" experience when using any Mini Program model. However, the size of the 2MB also limits the expansion of Mini Program"s functions, and the development of Mini Program"s business may need a larger volume. So is there a way to maintain a good experience speed while adding Mini Program bags?
in order to resolve this contradiction, Wechat launched a "subcontract loading scheme"
principle introduction:
when Mini Program starts, the main package will be downloaded and the page within the main package will be launched by default. If the user needs to open a page within the subpackage, the client will download the corresponding subpackage and display it after the download is completed.