目录

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, the system triggers preloading of associated modules after a user taps the module and its page loading is complete.

NOTE

In the preloads list, the value of ModuleType corresponding to moduleName cannot be entry.

You can configure the preloads field under atomicService in the module.json5 file of the specified subpackage module. The following uses module.json5 of the entry module as an example:

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

Once the entry module page finishes loading, the system automatically runs the preloading process to download and install the library module.