目录

Preloading

You can configure preloading so that the system automatically downloads and installs the possible required subpackage modules, improving the speed of accessing subsequent modules.

For a subpackage module configured with preloading, when a user taps to enter the module and the page is loaded, the preloading of the associated module is triggered.

The type (module type) corresponding to moduleName configured in the preloads list cannot be entry.

Preloading is configured in the preloads field under atomicService in the module.json5 configuration file of the corresponding subpackage module. The following uses the module.json5 of the entry module as an example:

{
  "module": {
    "name": "entry",
    "type": "entry",
    "installationFree": true,
    "pages": "$profile:main_pages",
    "atomicService": {
      "preloads": [
        {
          "moduleName": "library"
        }
      ]
    },
    ...
  }
}

After the page of the entry module is loaded, the system automatically performs preloading to download and install the library module.