Custom Project Build Process
Folder Structure:
If the current platform is Web-Mobile
, then build-templates/web-mobile/index.html
will be copied to build/web-mobile/index.html
.
Since the content of the package is not guaranteed to be exactly the same in every version, when the build template within the editor is updated, the developer also needs to update the build template within their project. Now add a new way to use the template, click on Project -> Create preview template in the main menu, and an ejs
template file will be generated for the corresponding platform.
project-folder
|--assets
|--build-templates
|--index.ejs
Parameters are imported into these templates during the build, and content that is frequently changed during the build is placed in sub-templates of that template. You only need to modify what you want to use, so that the build templates within the project can be updated less frequently.
Many mini games have their own configuration JSON
files, like game.json
to WeChat Mini Games. Files in the build templates folder will just copy in default, but this configuration JSON will be merged instead of overwrite. Of course, it doesn’t mean that all JSON
file will be merged, you can check it in the tables below.
The JSON
files corresponding to the data fusion for each mini game are as follows: