Publication of Egret engine development guidelines

  • 2020-03-30 03:49:12
  • OfStack

At Egret, the release feature is also very simple to use. All you need to do is use the following command:


egret publish HelloWorld

Egret publish is the publish command in this command, and HelloWorld is the name of your current project.

Upon execution of this command, egret initiates release packaging. At this point, the release process can take longer than the build function. Because the Egret tool does the final release of your game code, which is a very strict compilation process. The process is very complicated. We just need to understand what it does.

After performing the release function, Egret encrypts and confuses your source code and puts all the js code into a game-min.js file, where the contents are confused and compressed. This allows you to upload the files in the release folder of the 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 version Numbers for packaged files, using the following command:


egret publish HelloWorld --v abc

Use the above command to generate a folder named ABC under the release folder to hold the post-release code.

-- the v parameter specifies the release version number and the folder name after the release.

Modular compilation

In previous versions of egret, all the code in the engine would be compiled into a single file after publish, but the developer would probably not use all the functionality in the engine, which incurs additional network transfer 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. The developer only needs to configure your module in the egretProerties.


Related articles: