收藏
回答

request to add configuration project.config.json?

Dear, this is a request to enhance the usage of the project.config.json file and the inclusion of the section "Enable Custom Processing Commands". We are generating WeChat Miniprogram projects from a code generation tool and want to use the CLI to directly compile the project and generate a QR code for testing. As we use typescript we need to enable the "Enable Custom Processing Commands" option, it is mandatory for us. As this configuration is not possible to set on the project.config.json (at least we did not find a way), we must enter the IDE manually to check it, then do the compilation and following steps. Because of this issue, we cannot automate the process from a CI/CD perspective. Is there an alternative on the case we could evaluate? Hope to have explained clearly the case. Using WeChat DevTools Stable # 1.05.2107090. regards,

回答关注问题邀请回答
收藏

2 个回答

  • commy
    commy
    2021-09-23

    Hi, you can use miniprogram-ci to do the same thing. miniprogram-ci is a npm package, and support previewing your miniprogram project on wechat or uploading your miniprogram project to wechat-server . Basically, it can replace all the functions CLI provides in the CI or CD scene.

    https://www.npmjs.com/package/miniprogram-ci

    https://developers.weixin.qq.com/miniprogram/dev/devtools/ci.html

    So, if you use miniprogram-ci, you can control what kind of things you want to do before uploading miniprogram project. For the ts files, before previewing or uploading your project, you can invoke your npm script `npm run tsc` to compile the ts files to js files.

    In addition, in the latest RC version of the tool, we have optimized the support for TypeScript projects. There is no need to use script commands to compile ts files into js files. You could have a try. https://developers.weixin.qq.com/miniprogram/dev/devtools/compilets.html

    2021-09-23
    有用 1
    回复
  • 工号 9527
    工号 9527
    2021-09-23

    due to safety concerns, we don't checked the option for the imported project and temp project

    here are a few solution for your case

    1. in ci/cd case you could run the command before use the cli.
    2. we already support using ts project to preview or upload directly in 1.05.2109091 RC , no need to transform it to es5 by the custom processing commands. by set ‘miniprogramRoot’ in project.config.json to your src directory and add "useCompilerPlugins" in "setting" option.

    3 also you could use https://www.npmjs.com/package/miniprogram-ci to preview or upload , instead of using Wechat Devtools

    2021-09-23
    有用
    回复
登录 后发表内容