In Egret, it is also very easy to use the Publish feature. You only need to use the following command:
In this command, Egret Publish is the publication command, HelloWorld is the name of your current project.
After you execute this command, Egret launches the publish packaging work. The publishing process at this point may take longer than the build feature. Because the Egret tool will do the final release work on your game code, this job is a very strict compilation process. The process is very complex. We just need to understand how it works.
You also need to install JAVA7 with the Egret Publishing feature. You should install Java7 or later to support your release function.
After performing the publishing function, Egret will confuse your source code and put all the JS codes into the Game-min.js file, and the contents of the file are confused and compressed. This allows you to upload files from the release folder in your project to your server and 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 commands:
Egret Publish HelloWorld--V ABC
Use the above command to generate a folder named ABC under the release folder, which holds the post code.
The--V parameter specifies the version number of the publication, and also corresponds to the folder name after the publication was generated.
Modular compilation
In prior versions of Egret, all the code in the engine was compiled into a file after publish, but the developer would probably not use all of the features in the engine, which created additional network transport overhead.
We have focused on optimizing this issue in the 1.0.4 version. Now the Egret engine is divided into Core/gui/dragonbones/html5/native 5 modules, developers only need to configure your module in the Egretproerties.json file, you can compile the specified module to reduce the volume of the compilation.