When exporting to the WeChat Mini Game platform, there are the following configuration items:
Configuration | Describe | Corresponding to the configuration file of WeChat Mini Games | Corresponding to the fields in WeChat Mini Games |
---|---|---|---|
AppId | AppId of WeChat Mini Game, required. The wxdf8199565c509fb9 in the screenshot is a test account. | project.config.json | appid |
Orientation | Set the game screen orientation: Landscape, Portrait | game.json | deviceOrientation |
Request | wx.request timeout, unit: milliseconds | game.json | networkTimeout.request |
Connect Socket | wx.connectSocket timeout, unit: milliseconds | game.json | networkTimeout.connectSocket |
Upload File | wx.uploadFile timeout, unit: milliseconds | game.json | networkTimeout.uploadFile |
Download File | wx.downloadFile timeout, unit: milliseconds | game.json | networkTimeout.downloadFile |
For more configuration details, see: project.config.json、game.json
After selecting the WeChat Mini Game platform, click the download button at the bottom of the export panel to export the required project:
1、After exporting the project to the local computer, first go to the root directory and execute the following command to install the dependent packages:
npm i
2、Open WeChat Developer Tools, select Mini Game, and import the project just now, as follows:
3、In WeChat Developer Tools, click Tools->Build npm, as follows:
4、After completing the above 3, you can preview the final result in the WeChat developer tool as follows:
5、For debugging in WeChat developer tools, see: WeChat Mini Game Debugging
After local debugging is completed, you can publish it. For details on the publishing process, see: WeChat Mini Games Publish
The project directory exported to the local is as follows:
Project Catalog Description
Directory or file | Describe |
---|---|
adapters | Engine-related packages used in the project, exported on demand |
public | Asset directory. All assets of the editor are exported to this directory. The path of the asset is /public/xxx |
scripts | After the script components added by the developer in the editor are exported to the local computer, the developer can perform secondary development in the script components inside. |
game.json | Corresponding to the requirements of WeChat mini-game projects game.json |
game.ts | Entry file, the initialization logic is placed here |
package.json | Mainly store project dependency packages |
polyfill.js | Developers do not need to worry about platform DOM adaptation code and global variable adaptation code |
project.config.json | Corresponding to the requirements of WeChat mini-game projects project.config.json |
project.ts | Galacean project files are parsed during initialization |