cocos_set_bundle_config
Configure asset bundles in Cocos Creator by marking folders and setting properties like compression, priority, and remote loading for optimized game resource management.
Instructions
Mark a folder as an Asset Bundle by patching its .meta sidecar.
folder_rel_path: relative to project root, e.g. 'assets/levels/world1'. bundle_name: defaults to the folder's basename when None. priority: bundle load priority 1..N (higher = loaded first). compression_type: {platform: mode}. Common modes:
'merge_dep' (default for most platforms)
'subpackage' (WeChat — requires also calling cocos_set_wechat_subpackages with matching root)
'zip' (compress entire bundle)
'none' (no compression) Example: {"web-mobile": "merge_dep", "wechatgame": "subpackage"} is_remote: {platform: bool} to enable remote/CDN loading per platform.
At runtime, load via cc.assetManager.loadBundle('<bundle_name>').
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | Yes | ||
| folder_rel_path | Yes | ||
| bundle_name | No | ||
| is_bundle | No | ||
| priority | No | ||
| compression_type | No | ||
| is_remote | No |