Project Configuration
The project.config.json file in the project root directory can configure the project.
The project.config.json file is mainly used to configure the behavior and features of the mini program development tool in the mini program. This file allows developers to adjust some default settings of the development tool to better adapt to the development process and environment.
Configuration item
| Properties | Type | Description |
|---|---|---|
| miniprogramRoot | Path String | Specify the directory of the mini program source code (must be a relative path). |
| compileType | String | Compilation type, the default value is miniprogram. |
| TCMPPappid | String | Project appid |
| projectname | String | Project name |
| setting | Object | Project settings |
| libVersion | String | Base library version |
| condition | Object | Conditional compilation configuration |
| mockConfig | Object | IDE mockAPI configuration |
miniprogramRoot
Mini program source code directory (must be a relative path)
{
"miniprogramRoot": "./src"
}compileType
Compilation type, the default value is miniprogram
{
"compileType": "miniprogram"
}TCMPPappid
The corresponding appId of the mini program on the Luffa Cloud console.
{
"TCMPPappid": "mpz5g4hpzd5p3k2l"
}projectname
Project name.
{
"projectname": "main-demo"
}setting
Project compilation settings, you can specify the following settings.
The following fields can be matched in Developer Tools > Details > Local Settings.

| Field Name | Type | Description |
|---|---|---|
| es6 | Boolean | Whether to enable es6 to es6 |
| postcss | Boolean | Whether to automatically complete the style when uploading code |
| minified | Boolean | Whether to automatically compress the script file when uploading code |
| uglifyFileName | Boolean | Protect the code when uploading |
| urlCheck | Boolean | Whether to check the secure domain name and TLS version and HTTPS certificate |
libVersion
The version number of the basic library currently used.
{
"libVersion": "1.5.0"
}condition
Corresponds to the conditional compilation information set on the IDE.

{
"condition": {
"miniprogram": {
"current": 0,
"list": [
{
"id": 0,
"name": "tab3",
"pathName": "page/extend/index",
"query": "",
"scene": null
},
{
"id": -1,
"name": "tab4",
"pathName": "page/extend/index",
"query": "name=1",
"scene": null
}
]
}
}
}mockConfig

{
"globalOpen": true,
"rules": [
{
"ruleName": "testApi",
"ruleId": "48b83a70-84fd-400d-b53d-097518cfa515",
"apiName": "invokeNativePlugin",
"enable": true,
"mockType": "API",
"returnType": "succ",
"resStr": "{\n\"name\": 1,\n\"cvv\": 2,\n\"ccdd\": \"c223344\"\n}",
"filterList": [
{
"propName": "api_name",
"propRegString": "testApi",
"matchType": "string"
},
{
"propName": "",
"propRegString": "",
"matchType": "string"
}
],
"verifyFail": false
}
]
}