Egret Engine Development Guide-release project_node. js

Source: Internet
Author: User
After creating a project, we need to release the project as the official version and provide it to players online. The simple use of the build command in egret is not to package the final official file. You also need to perform the final release operation. In Egret, the publishing function is also very simple. You only need to use the following command:

egret publish HelloWorld

In this command, egret publish is the release command, and HelloWorld is the name of your current project.

After you run this command, egret starts the release package. In this case, the release process may take longer than the build function. Because the Egret tool will make the final release of your game code, this work is a very strict compilation process. The process is very complicated. We only need to understand its role.

You also need to install Java 7 to use the release function of Egret. You should install Java 7 or later to support your release function.

After the release function is executed, Egret will encrypt and confuse your source code, and put all the js Code into the game-min.js file, and the content of the file is obfuscated and compressed. In this way, you can upload files in the project's release folder to your server and access the corresponding URL to open the game.

The final game access address is the index.html file under the release directory.

You can also create a version number for the packaged file by running the following command:

egret publish HelloWorld --v abc

Use the above command to generate a folder named abc under the release folder, which contains the released code.

The -- v parameter specifies the version number of the release, and the folder name after the release is generated.

Modular Compilation

In versions earlier than egret, all the code in the engine will be compiled into a file after publish, but developers may not use all the functions in the engine, resulting in additional network transmission overhead.

In version 1.0.4, We optimized this problem. Currently, the egret engine has five modules: core/gui/dragonbones/html5/native. Developers only need to go to egretProerties. by configuring your module in the json file, you can compile the specified module to reduce the compilation volume.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.