From 7b104df4636765e2a2649e0e838a06d00160c8e5 Mon Sep 17 00:00:00 2001 From: xmk23333 Date: Thu, 15 Jan 2026 19:31:34 +0800 Subject: [PATCH] fix: configure CJS output for Electron 22 in windows7 build --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4d06514..e5176ac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -200,6 +200,9 @@ jobs: pnpm add @mihomo-party/sysproxy-win32-${{ matrix.arch }}-msvc pnpm add -D electron@22.3.27 (Get-Content electron-builder.yml) -replace 'windows', 'win7' | Set-Content electron-builder.yml + # Electron 22 requires CJS format + (Get-Content package.json) -replace '"type": "module"', '"type": "commonjs"' | Set-Content package.json + (Get-Content electron.vite.config.ts) -replace 'plugins: \[externalizeDepsPlugin\(\)\]', "plugins: [externalizeDepsPlugin()],`n build: { rollupOptions: { output: { format: 'cjs' } } }" | Set-Content electron.vite.config.ts - name: Update Version for Dev Build if: github.event_name == 'workflow_dispatch' env: