Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix(mini-ci): watch 模式下保留 weapp.devToolsInstallPath 配置
WeappCI.init() 会把 devToolsInstallPath 从共享的插件配置中删除,watch 模式第二次构建时就退回默认安装路径。不再删除该字段,并补充连续两次构建的回归测试。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
  • Loading branch information
2 people authored and Single-Dancer committed Oct 30, 2026
commit 10a26ed9d1e0197b42351f3e890b4498100a541d
1 change: 0 additions & 1 deletion packages/taro-plugin-mini-ci/src/WeappCI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export default class WeappCI extends BaseCI {
process.exit(1)
}
this.devToolsInstallPath = this.pluginOpts.weapp.devToolsInstallPath || (process.platform === 'darwin' ? '/Applications/wechatwebdevtools.app' : 'C:\\Program Files (x86)\\Tencent\\微信web开发者工具')
delete this.pluginOpts.weapp.devToolsInstallPath

const weappConfig = {
type: 'miniProgram' as ProjectType,
Expand Down
18 changes: 18 additions & 0 deletions packages/taro-plugin-mini-ci/tests/open-devtools.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,24 @@ function setup () {
return { root, projectPath, argsFile, ctx, createCli }
}

describe('weapp devToolsInstallPath', () => {
it('keeps the configured path for the next build in watch mode', () => {
const { root, ctx } = setup()
const installPath = path.join(root, 'devtools')
// watch 模式下每次构建都会用同一份插件配置创建新的 WeappCI
const pluginOpts = {
weapp: { appid: 'wx0000000000000000', privateKeyPath: 'private.key', devToolsInstallPath: installPath }
}

for (let build = 0; build < 2; build++) {
const ci = new WeappCI(ctx as any, pluginOpts)
ci.init()
expect((ci as any).devToolsInstallPath).toBe(installPath)
}
expect(pluginOpts.weapp.devToolsInstallPath).toBe(installPath)
})
})

const describeOnWindows = process.platform === 'win32' ? describe : describe.skip

describeOnWindows('open devtools on Windows', () => {
Expand Down
Loading