diff --git a/.vscode/launch.json b/.vscode/launch.json index a912834..3ac8e53 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -2,9 +2,11 @@ "version": "1.0.0", "compounds": [ { - "name": "Debug Run", + "name": "Debug Everything", "configurations": [ - "Debug App" + "Launch App", + "Attach to Main Process", + "Attach to Renderer Process" ], "presentation": { "hidden": false, @@ -16,7 +18,7 @@ ], "configurations": [ { - "name": "Debug App", + "name": "Launch App", "request": "launch", "type": "node", "timeout": 60000, @@ -26,7 +28,36 @@ ], "cwd": "${workspaceRoot}", "runtimeExecutable": "npm", - "console": "integratedTerminal" + "console": "integratedTerminal", + "env": { + "REMOTE_DEBUGGING_PORT": "9229" + }, + "outputCapture": "std", + "sourceMaps": true, + }, + { + "name": "Attach to Main Process", + "type": "node", + "request": "attach", + "port": 9228, + "restart": false, + "timeout": 10000, + "skipFiles": ["/**"], + "sourceMaps": true, + "outFiles": ["${workspaceFolder}/dist/**/*.js"], + "outputCapture": "std", + "env": { + "REMOTE_DEBUGGING_PORT": "9228" + } + }, + { + "name": "Attach to Renderer Process", + "type": "chrome", + "request": "attach", + "port": 9229, + "webRoot": "${workspaceFolder}/src/renderer", + "timeout": 30000, + } ] } diff --git a/vite.config.mts b/vite.config.mts index 622747f..afdc76d 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -29,14 +29,16 @@ export default defineConfig(({ mode }) => { { entry: 'src/main/index.ts', onstart({ startup }) { - startup() + const debugArgs = ['.', '--inspect=9228', '--remote-debugging-port=9229'] + startup(debugArgs) }, vite: { root: resolve('.'), base: './', + publicDir: resolve('./src/public'), build: { + sourcemap: true, assetsDir: '.', - publicDir: resolve('./src/public'), outDir: 'dist/main', rollupOptions: { external: ['electron', ...builtinModules]