Tencent Cloud wecos WeChat Mini Program COS Size Reduction Solution
Through WeCOS, upload mini program image resources to Tencent Cloud COS, automatically reference online addresses, remove image resources, and solve package size limitation issues.
docker run --rm -v $(pwd):$(pwd) -w $(pwd) tencentcom/tencentyun-wecos
main:
push:
- stages:
- name: tencentyun-wecos
image: tencentcom/tencentyun-wecos
Create a wecos.config.json file at the same level as your mini program directory
Example of wecos.config.json configuration:
{
"appDir": "./app",
"cos": {
"secret_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
"secret_key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"bucket": "wxapp-1251902136",
"region": "ap-guangzhou", //Region abbreviation selected when creating bucket
"folder": "/", //Directory in the bucket where resources are stored
}
}
Mini program project directory, default is ./app.
Required, fill in the configuration information for uploading to COS, some information can be viewed in the COS console
See: Tencent Cloud wecos