Today, after packing the project, I tried to run it on the real machine to see the effect. The result reported an error: the package size exceeded the limit

Baidu later learned that the size of the code package should not exceed 2M

The solution: subcontract loading

To put it simply: subcontracting is to divide a code package exceeding the limit into several small code packages. I divide the idea of subcontracting according to the function and logic. For details, please refer to the official document of the small program about subcontracting

Configure your subcontracting structure in app.json

— — — — — — — — — — — — — — — — — — — — — — — — — –

In addition, we should also pay attention to the uploading of pictures to the server as far as possible, and pay attention to the size of pictures, too many local pictures, also largely lead to the code package is too large