From 798c5d69f9cb7227804de8af94bc5e6e00c1164e Mon Sep 17 00:00:00 2001 From: Pier-Paolo Mammi Date: Mon, 27 Apr 2026 12:41:29 +0200 Subject: [PATCH] add debug capabilities in vscode --- .vscode/launch.json | 25 +++++++++++++++---------- .vscode/tasks.json | 29 +++++++++++++++++++++++++++++ scelta-carriera/vite.config.js | 7 +++++++ 3 files changed, 51 insertions(+), 10 deletions(-) create mode 100644 .vscode/tasks.json diff --git a/.vscode/launch.json b/.vscode/launch.json index aa73b0a..4900ffc 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,15 +5,20 @@ "version": "0.2.0", "configurations": [ { - "name": "Hosted workbench", - "type": "msedge", - "request": "launch", - "url": "http://localhost:5173/", - "webRoot": "${workspaceRoot}", - "runtimeArgs": [ - "--remote-debugging-port=9222", - "-incognito" - ] + "type": "pwa-chrome", + "request": "attach", + "name": "Debug Vite App (scelta-carriera)", + "url": "http://localhost:5173", + "webRoot": "${workspaceFolder}/scelta-carriera", + "preLaunchTask": "Start Vite App (scelta-carriera)", + "skipFiles": [ + "/**", + "**/node_modules/**", + "**/@vite/client/**" + ], + "sourceMapPathOverrides": { + "webpack:///src/*": "${webRoot}/*" + } } ] -} \ No newline at end of file +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..22cc73f --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,29 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Start Vite App (scelta-carriera)", + "type": "shell", + "command": "npm run dev", + "isBackground": true, + "options": { + "cwd": "${workspaceFolder}/scelta-carriera" + }, + "problemMatcher": { + "pattern": [ + { + "regexp": ".*", + "file": 1, + "location": 2, + "message": 3 + } + ], + "background": { + "activeOnStart": true, + "beginsPattern": "vite", + "endsPattern": "ready in" + } + } + } + ] +} \ No newline at end of file diff --git a/scelta-carriera/vite.config.js b/scelta-carriera/vite.config.js index 8b0f57b..cb3cbf2 100644 --- a/scelta-carriera/vite.config.js +++ b/scelta-carriera/vite.config.js @@ -4,4 +4,11 @@ import react from '@vitejs/plugin-react' // https://vite.dev/config/ export default defineConfig({ plugins: [react()], + build: { + outDir: 'dist', + rollupOptions: { + input: 'src/main.jsx', + }, + sourcemap: true, + }, })