Use UNIAPP to subcontract small programs
The first step is to create a catalog of subcontracts
Non-essential (code, image resources that the user did not use when first loading) resources do not put in the code necessary resources are put in the main package
The second part
Then we put our infrequently critical user feedback page into a new subcontract document
The third step is to configure the subcontracting path in the page. Josn file
Root indicates the subcontract root directory
Pages: Array of pages
Path: relative path
Then we need to change the path to the file
Subcontracting is done!!
So here’s the summary
Package limit
Why does wechat need to limit the size of packets?
When first accessed, if the package is too large, the load speed will be slow
Primary package resource policy?
The main packet limit is 2M
Non-essential (code, image resources that the user didn’t use when they first loaded) resources don’t go into the code
The necessary resources are in the main package
The sub-contract strategy
Wechat allows us to separate our code into different packages, master and subcontractor
Loading time of the main package: The QR code will be loaded when the user scans the applet
Subcontracted load time: subcontracted content is loaded when the user uses it
What pages to subcontract?
Put less used pages into subcontracting Notes:
The original jump page path needs to be changed to the subcontracted path
Limit of wechat total package?
Currently, the subcontracting size of small program has the following limitations:
- The whole small program all subcontracting size is not more than 16M
- The size of a single subcontract/main package cannot exceed 2M