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:
@@ -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(),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user