Build Options
General Build Options
For the general build options in the Build panel are as follows:
Build Path
You can designate a release path for the game by inputting a path in the Build Path input field or choosing one via the search icon button. The following cross-platform release will create assets or projects in child folders of this release path.
The default release path is in the build
under the project folder. If you use version control systems like git
and svn
, you can ignore the build
folder in version control.
Included Scenes
There are usually multiple game scenes in the project, this option allows you to choose the scenes you want to package. During the build process, all assets that depended on these selected scene assets in deep will be packaged. Just select the game scenes that are actually needed can reduce the size of game package after build.
Start Scene
The first scene after entering the game can be set directly in the Start Scene. You can also choose other scenes, that are part of your game, in Included Scenes. Move the mouse to the scene, a move up icon
button will appear after the scene, then click the button to set it.
MD5 Cache
Append MD5 hash to the exported assets for resolving CDN or browser cache issue.
After being enabled, if any asset fails to load, it is because the renamed new file can not be found. It is usually because some third-party assets were not loaded by assetManager
. If this happens, you can convert the url before loading, to fix the loading problem. Example:
const uuid = assetManager.utils.getUuidFromURL(url);
url = assetManager.utils.getUrlWithUuid(uuid);
Note: when MD5 Cache is enabled on the native platform, if any asset fails to load, it is usually because some third-party assets used in C++ were not loaded by
assetManager
. This can also be solved by converting the URL with the following code:
auto cx = ScriptingCore::getInstance()->getGlobalContext();
JS::RootedValue returnParam(cx);
ScriptingCore::getInstance()->evalString("cc.assetManager.utils.getUrlWithUuid(cc.assetManager.utils.getUuidFromURL('url'))", &returnParam);
string url;
jsval_to_string(cx, returnParam, &url);
Main Bundle Compression Type
Set the compression type of the main package, please refer to the Asset Bundle — Compression Type documentation for details.
Main Bundle Is Remote
This option is optional and needs to be used with the Resource Server Address option.
If set, the main package is configured as a remote package, and along with its related dependent resources are built into a built-in Asset Bundle — main under the remote
folder of the release package directory. You need to upload the entire remote
folder to the remote server.
Resource Server Address
This option is optional and used to fill in the address of the remote server where the resources are stored.
- If this option is left blank, the
remote
folder in the release package directory will be packaged into the built game package. - If this option is filled in, the
remote
folder will not be packaged into the built game package. You need to manually upload theremote
folder to the filled in resource server address after build.
Debug
If this option is not checked, release mode will be built and the editor will compress and obfuscate the uuid
of the asset, the engine script and project script generated by the build, and subpackage the json
of the same type asset, reducing the times of asset loading.
If this option is checked, debug mode will be built, allowing you to debug the project and easily locate problems.
Source Maps
The build will compress engine files and project scripts by default, if you want to generate a sourcemap
, you need to check this box.
A source map
is a file that maps from the transformed source to the original source, enabling the browser to reconstruct the original source and present the reconstructed original in the debugger.
For more details on source maps
, please refer to the Use a source map documentation.
Replace Splash Screen
Mouse over this option and an Edit icon button will appear. Click this button and the panel will open. The first time you use this feature you need to fill out a questionnaire before opening the Replace Splash Screen panel. There will be some project-based information in the questionnaire, and we hope to gather more information on games developed using Cocos Creator, as well as more support programs in the future that developers will hopefully be able to fill out truthfully.
Compress Texture
Some compression options can be added to spriteFrame
type image assets in the editor. Once enabled, the corresponding image assets are generated based on these compression options during build. If disabled, the compression texture will not take effect at build time even if configured.
Please refer to the Compress Texture documentation for details.
PackAutoAtlas
The Auto Atlas is the editor’s built-in texture merge. If this is disabled, even if you configure the Auto Atlas, it will not take effect at build time.
When the Auto Atlas is configured in the resources
folder, both the clarge and small image resources and the corresponding serialization information will be packaged, which will increase the package size, So please do not use it like that unless necessary.
Please refer to the Auto Atlas documentation for details.
Earse module structure (experimental)
If this option is checked, importing scripts will be faster, but you will not be able to use module characteristics, such as import.meta
, import()
, etc.
Build options related to each platform
Currently, due to the adjustment of the build mechanism, the processing of different platforms are injected into the Build panel as plugins. After you select the platform you want to build in the Platform of the Build panel, you will see the expanded options for the corresponding platform, and the name of the expanded options is the platform plugin name. You can see each platform plugin in Extension -> Extension Manager -> Internal of the main menu of the editor.
Custom build plugins are handled in the same way as platform plugins, see Extend the Build Process for details.
Configuration of other parameters involved in the build
The configuration in the editor menu bar Project -> Project Settings will affect the result of the project build, please refer to Project Settings for details.