Files
multica/electron.vite.config.ts
yushen b8e3884e74 fix: resolve PATH issue for macOS GUI apps
GUI apps on macOS don't inherit PATH from shell dotfiles (.zshrc, .bashrc, etc.).
This causes agent commands to fail when launched from Finder/Dock.

- Add fix-path dependency to correct PATH on app start
- Configure electron-vite to bundle ESM-only dependencies (fix-path, shell-path, strip-ansi)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 15:25:02 +08:00

39 lines
880 B
TypeScript

import { resolve } from 'path'
import { defineConfig } from 'electron-vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
main: {
build: {
// Bundle ESM-only dependencies (like fix-path, shell-path) into CJS
// See: https://electron-vite.org/guide/troubleshooting
externalizeDeps: {
exclude: ['fix-path', 'shell-path', 'strip-ansi']
}
},
resolve: {
alias: {
'@shared': resolve('src/shared')
}
}
},
preload: {
resolve: {
alias: {
'@shared': resolve('src/shared')
}
}
},
renderer: {
resolve: {
alias: {
'@renderer': resolve('src/renderer/src'),
'@': resolve('src/renderer/src'),
'@shared': resolve('src/shared')
}
},
plugins: [react(), tailwindcss()]
}
})