genything / .vscode /launch.json
burtenshaw
first commit
ea3f4d3
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch SvelteKit Dev Server",
"type": "node-terminal",
"request": "launch",
"command": "npm run dev",
"cwd": "${workspaceFolder}",
"envFile": "${workspaceFolder}/.env", // Keep consistent env loading
"serverReadyAction": {
"pattern": "Local:\\\\s+(http://localhost:\\\\d+)", // Pattern to detect server ready
"uriFormat": "%s",
"action": "debugWithChrome" // Launch Chrome debugger when ready
},
"presentation": {
"hidden": false,
"group": "SvelteKit",
"order": 0 // Put it first
}
},
{
"name": "Attach to SvelteKit Dev Server",
"type": "node", // Use 'node' for attaching
"request": "attach",
"port": 9229, // Default Node.js inspect port, Vite might need config to use this
"skipFiles": [
"<node_internals>/**",
"**/node_modules/**"
],
"sourceMaps": true, // Enable source maps for debugging TS/Svelte
"smartStep": true,
// Ensure environment variables from .env are loaded by the process you attach to
// (npm run dev usually handles this via Vite's dotenv support)
"envFile": "${workspaceFolder}/.env", // Correct for project at root
"restart": true, // Automatically try to re-attach
"presentation": {
"hidden": false,
"group": "SvelteKit",
"order": 1
}
},
{
"name": "Launch Chrome against localhost",
"type": "chrome",
"request": "launch",
"url": "http://localhost:5173", // Default Vite port
"webRoot": "${workspaceFolder}/src", // Corrected webRoot
"sourceMaps": true,
"presentation": {
"hidden": false,
"group": "SvelteKit",
"order": 2
}
}
],
"compounds": [
{
"name": "SvelteKit: Full Stack Debug",
"configurations": [
"Attach to SvelteKit Dev Server",
"Launch Chrome against localhost"
]
}
]
}