mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-23 18:10:26 +08:00
chore: update electron configuration and add debug script (#6361)
* chore: update electron configuration and add debug script - Added sourcemap generation for development builds in electron.vite.config.ts. - Introduced a new debug script in package.json for easier debugging with remote inspection. * docs: add debug section to development documentation - Introduced a new section for debugging instructions, including the command to run the debug script and how to access the Chrome inspect tool.
This commit is contained in:
parent
2bf2e2febb
commit
92aa9f9c8e
@ -37,6 +37,14 @@ yarn install
|
|||||||
yarn dev
|
yarn dev
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Debug
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn debug
|
||||||
|
```
|
||||||
|
|
||||||
|
Then input chrome://inspect in browser
|
||||||
|
|
||||||
### Test
|
### Test
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@ -38,7 +38,11 @@ export default defineConfig({
|
|||||||
build: {
|
build: {
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
external: ['@libsql/client']
|
external: ['@libsql/client']
|
||||||
}
|
},
|
||||||
|
sourcemap: process.env.NODE_ENV === 'development'
|
||||||
|
},
|
||||||
|
optimizeDeps: {
|
||||||
|
noDiscovery: process.env.NODE_ENV === 'development'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
preload: {
|
preload: {
|
||||||
@ -47,6 +51,9 @@ export default defineConfig({
|
|||||||
alias: {
|
alias: {
|
||||||
'@shared': resolve('packages/shared')
|
'@shared': resolve('packages/shared')
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
build: {
|
||||||
|
sourcemap: process.env.NODE_ENV === 'development'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
renderer: {
|
renderer: {
|
||||||
|
|||||||
@ -20,6 +20,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "electron-vite preview",
|
"start": "electron-vite preview",
|
||||||
"dev": "electron-vite dev",
|
"dev": "electron-vite dev",
|
||||||
|
"debug": "electron-vite -- --inspect --sourcemap --remote-debugging-port=9222",
|
||||||
"build": "npm run typecheck && electron-vite build",
|
"build": "npm run typecheck && electron-vite build",
|
||||||
"build:check": "yarn test && yarn typecheck && yarn check:i18n",
|
"build:check": "yarn test && yarn typecheck && yarn check:i18n",
|
||||||
"build:unpack": "dotenv npm run build && electron-builder --dir",
|
"build:unpack": "dotenv npm run build && electron-builder --dir",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user