Mini Program Configuration
The app.json file in the root of the Mini Program provides global configuration of the whole program.
Configuration items
| Properties | Type | Required | Description | Minimum Version |
|---|---|---|---|---|
| configVersion | string | YES | Configuration file version number, supports the following values: v3 currently , v1 deprecated used. All features labeled v3 in this article require the v3 version of app.json to work properly. | - |
| app | object | YES | Mini Program configuration information. | - |
| runtime | object | YES | Mini Program runtime settings. | - |
| permissions | Array<string> | YES | List of Mini Program permissions. | - |
| targets | object | YES | Build Mini Program installer setup. | - |
| i18n | object | YES | Mini Program internationalization configuration. | - |
| defaultLanguage | string | YES | The default language setting for the Mini Program. This value is used as the language of the program when the system cannot find a suitable language to set the program. This value is not recommended to be empty. | - |
| debug | boolean | NO | Mini Program debugging function, supports the following values: true Enable debugging function; false Default value. Turn off the debugging function. | - |
configVersion
configVersion is the version of the JSON file and is used for parsing distinctions. The format is lowercase v + a number, e.g., v3.
Examples are as follows:
{
"configVersion": "v3"
}
app
app indicates program configuration information.
| Properties | Type | Required | Description | Minimum Version |
|---|---|---|---|---|
| appId | number | YES | The Mini Program "id", "id" is the unique identification of the Mini Program. | v2 |
| appName | string | YES | Mini Program Name. | v2 |
| appType | string | YES | Mini Program type. The following values are supported: app Mini Program; watchface dial. | v2 |
| version | object | YES | Mini Program version information. | v2 |
| icon | string | NO | The path to the Mini Program icon. Reference Design Specifications - app icons. If not passed, use the default icon. | v2 |
| vender | string | YES | Developer Name. | v2 |
| venderId | number | NO | Developer id. | - |
| cover | Array<string> | NO | Matching images for Mini Program display. In general, dials are used. | - |
| description | string | YES | Short description of the Mini Program. | v2 |
version: object
version indicates the version information of the Mini Program.
| Properties | Type | Required | Description | Minimum Version |
|---|---|---|---|---|
| code | number | YES | Mini Program program version number. The default starts from 1. Note: Each version should be larger than the previous one. For example: 12, 13, 2001, etc. | - |
| name | string | YES | Semantic version of the Mini Program. It is recommended that versions be recorded in the format x.x.x. For example: 1.0.1. | - |
Examples are as follows:
{
"app": {
"appId": 1000089,
"appName": "······",
"appType": "app",
"version": {
"code": 5,
"name": "0.0.5"
},
"icon": "logo.png",
"vender": "······",
"description": "······"
}
}