fix(stage-pocket): use system mkcert to work around feaxios download crash (#1220)

* fix(stage-pocket): use system mkcert to work around feaxios download crash

* fix(stage-pocket): add Windows compat for system mkcert lookup

Originally used `which` since this was an iOS-focused fix, but
considering Windows developers building for Android, use `where`
on win32 and handle multi-line output.
This commit is contained in:
Zen
2026-03-09 23:32:24 +07:00
committed by GitHub
parent 3ece47759e
commit e27b9859d5
+6 -1
View File
@@ -95,7 +95,12 @@ export default defineConfig({
},
plugins: [
...isEnvTruthy(process.env.VITE_SKIP_MKCERT ?? '') ? [] : [mkcert()],
...isEnvTruthy(process.env.VITE_SKIP_MKCERT ?? '') ? [] : [mkcert((() => {
// Workaround: plugin's bundled downloader has a feaxios bug, prefer system mkcert
const command = process.platform === 'win32' ? 'where' : 'which'
try { return { mkcertPath: execSync(`${command} mkcert`, { stdio: 'pipe' }).toString().trim().split(/\r?\n/)[0] } }
catch { return {} }
})())],
Info(),