Adapt to Platforms
Homogeneous files
You can write the programming logic by using different file extensions in your project to adapt to a specific platform.
.tsxuniversally used.web.tsxweb application.mini.tsxminiApp.wechat.tsxWeChat MiniApp.tuya.tsxSmart MiniApp
You can use the --target parameter in the command-line interface (CLI) to specify the platform for which your miniapp will be built and debugged. Then, the project files will be loaded sequentially from bottom to top in the preceding structure.
Runtime
Differentiate environment variables by runtime.
Example: