fix: configure CJS output for Electron 22 in windows7 build

This commit is contained in:
xmk23333 2026-01-15 19:31:34 +08:00
parent 7aea4af2d0
commit 7b104df463

View File

@ -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: