feat(playwright): enable Playwright in production builds with custom browser path

Move Playwright from dev to production dependencies and implement robust browser
management for company deployment environment:

- Move playwright and playwright-core to dependencies
- Set PLAYWRIGHT_BROWSERS_PATH to user data directory before imports
- Add startup validation for Chromium browser with friendly error dialog
- Update build scripts to skip browser download during build process
- Configure electron-builder to unpack Playwright for native module access
- Add deployment documentation for browser setup in restricted environments

This allows manual browser installation in company environments where direct
downloads are blocked during build.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
test
2026-03-07 19:03:29 +08:00
parent 9d15f7aca9
commit b3abad7fae
8 changed files with 444 additions and 14 deletions

View File

@@ -4,13 +4,7 @@ import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
main: {
build: {
rollupOptions: {
external: ['playwright', 'playwright-core']
}
}
},
main: {},
preload: {},
renderer: {
resolve: {