HomeDocs
Skip to main content

Subpackage Loading

Supported from Base Library version 7.2.0 and above. Please use Developer Tools version 0.17.0 or above. Click here to download.

In certain scenarios, developers may need to divide a miniApp into different subpackages, which are then packaged into different subpackages during the build process, and loaded as needed by the user.

When constructing a miniApp with subpackages, the build will output one or more subpackages. Each miniApp that uses subpackages will always include a main package. The main package contains the default startup pages/TabBar pages, as well as some common resources/JS scripts that all subpackages need to use; while subpackages are divided according to the developer's configuration.

When the miniApp starts, the main package is downloaded and the pages within it are launched by default. When the user navigates to a page within a subpackage, the client will download the corresponding subpackage. Once the download is complete, the page will be displayed.

Currently, the size limits for miniApp subpackages are as follows:

  • The total size of all subpackages within a miniApp must not exceed 20MB
  • The size of a single subpackage/main package must not exceed 2MB

Dividing a miniApp into subpackages can optimize the initial download time of the miniApp and facilitate better decoupling and collaboration when multiple teams are developing together.

For detailed usage instructions, please refer to:

Privacy agreementDeveloper agreementcontact us: developer_service.mi@transsion.com © 2024 MiniApp. All Rights Reserved.