In Egret, using the publishing function is also very simple. You just need to use the following command:
egret publish HelloWorld
In this command, egret publish is the publish command, and HelloWorld is the name of your current project.
After executing this command, egret will start publishing and packaging work. The release process at this time may take longer than the build function. Because the Egret tool will do the final release of your game code, this work is a very strict compilation process. The process is very complicated. We just need to understand its function.
Java7 is also required to use Egret's publishing function. You should install Java 7 or later to support your release features.
After executing the release function, Egret will encrypt and obfuscate your source code, and put all the js code into the game-min.js file, and the content in the file is obfuscated and compressed. In this way, you can upload files in the release folder in the project to your server, access the corresponding URL to open the game.
The final game access address is the index.html file in the release directory.
You can also create a version number for the packaged file, using the following command:
egret publish HelloWorld --v abc
Use the above command to generate a folder named abc in the release folder, which stores the published code.
--v parameter term specifies the version number of the published, and it will also correspond to the generated folder name after the release.
Modular Compilation
In versions before egret, all code in the engine was compiled into a file after publish, but developers are likely not to use all the features in the engine, which brings additional network transmission overhead.
In version 1.0.4, we focused on optimizing this problem. Now the egret engine is divided into 5 modules: core/gui/dragonbones/html5/native. Developers only need to configure your module in the egretProerties.json file to compile the specified modules to reduce the compilation volume.