2022-05-29 14:52:34 +00:00
|
|
|
{
|
|
|
|
"version": "0.2.0",
|
2022-11-20 20:33:10 +00:00
|
|
|
// https://code.visualstudio.com/docs/nodejs/browser-debugging for browser debugging docs
|
|
|
|
// https://github.com/microsoft/vscode-js-debug/blob/d77a474700e16d647e8fe68c205ef867094fa092/OPTIONS.md for browser debugging options
|
|
|
|
// https://github.com/vitejs/vite/issues/10372#issuecomment-1321219125 for debugging deeply nested `node_modules` dependencies in Chrome DevTools
|
2022-05-29 14:52:34 +00:00
|
|
|
"configurations": [
|
2022-11-20 20:33:10 +00:00
|
|
|
{
|
|
|
|
"name": "Attach to Vite via Chrome",
|
|
|
|
"url": "http://localhost:5173",
|
|
|
|
"request": "launch",
|
|
|
|
"type": "chrome",
|
2022-11-28 01:58:40 +00:00
|
|
|
"smartStep": true,
|
|
|
|
"sourceMaps": true,
|
|
|
|
"runtimeArgs": ["--auto-open-devtools-for-tabs"]
|
2022-11-20 20:33:10 +00:00
|
|
|
},
|
2022-09-16 13:49:20 +00:00
|
|
|
{
|
|
|
|
"type": "node",
|
|
|
|
"request": "launch",
|
|
|
|
"name": "Launch via Vite Node",
|
|
|
|
"runtimeExecutable": "node",
|
|
|
|
"skipFiles": ["<node_internals>/**"],
|
|
|
|
// todo?: make relative to ${file}
|
|
|
|
"cwd": "${workspaceFolder}/packages/status-js",
|
|
|
|
"program": "${workspaceRoot}/node_modules/vite-node/dist/cli.mjs",
|
2022-11-18 19:46:31 +00:00
|
|
|
"args": ["--options.sourcemap=inline", "${file}"],
|
2022-09-16 13:49:20 +00:00
|
|
|
"smartStep": true,
|
|
|
|
"sourceMaps": true,
|
|
|
|
"env": {
|
|
|
|
"DEBUG": "*",
|
2022-11-18 19:46:31 +00:00
|
|
|
"DEBUG_HIDE_DATE": "0",
|
|
|
|
"DEBUG_COLORS": "1",
|
2022-09-19 08:47:33 +00:00
|
|
|
"VITE_NODE": "true"
|
2022-11-18 19:46:31 +00:00
|
|
|
},
|
|
|
|
"runtimeArgs": ["--preserve-symlinks"],
|
|
|
|
"outFiles": ["${workspaceFolder}/**/*.js"],
|
|
|
|
"resolveSourceMapLocations": ["**/*"]
|
2022-09-16 13:49:20 +00:00
|
|
|
},
|
2022-05-29 14:52:34 +00:00
|
|
|
{
|
|
|
|
"type": "node",
|
|
|
|
"request": "launch",
|
2022-06-28 14:40:39 +00:00
|
|
|
"name": "Debug Client",
|
|
|
|
"autoAttachChildProcesses": true,
|
|
|
|
"skipFiles": ["<node_internals>/**"],
|
|
|
|
"cwd": "${workspaceFolder}/packages/status-js",
|
|
|
|
"program": "${workspaceRoot}/node_modules/vite-node/dist/cli.mjs",
|
|
|
|
"args": ["src/index.ts"],
|
2022-05-29 14:52:34 +00:00
|
|
|
"smartStep": true,
|
2022-06-28 14:40:39 +00:00
|
|
|
"console": "integratedTerminal",
|
|
|
|
"sourceMaps": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "node",
|
|
|
|
"request": "launch",
|
|
|
|
"name": "Debug Test File",
|
|
|
|
"autoAttachChildProcesses": true,
|
|
|
|
"skipFiles": ["<node_internals>/**"],
|
|
|
|
"program": "${workspaceRoot}/node_modules/vitest/vitest.mjs",
|
|
|
|
"args": ["run", "${relativeFile}"],
|
|
|
|
"smartStep": true,
|
|
|
|
"console": "integratedTerminal",
|
|
|
|
"sourceMaps": true
|
2023-04-26 10:06:18 +00:00
|
|
|
},
|
|
|
|
{
|
2023-05-29 15:11:02 +00:00
|
|
|
"name": "Launch Website via Next.js (server-side)",
|
2023-04-26 10:06:18 +00:00
|
|
|
"type": "node-terminal",
|
|
|
|
"request": "launch",
|
2023-05-29 15:11:02 +00:00
|
|
|
"cwd": "${workspaceFolder}/apps/website",
|
2023-04-26 10:06:18 +00:00
|
|
|
"command": "yarn dev"
|
|
|
|
},
|
|
|
|
{
|
2023-05-29 15:11:02 +00:00
|
|
|
"name": "Attach to Website via Next.js (client-side)",
|
2023-04-26 10:06:18 +00:00
|
|
|
"type": "chrome",
|
|
|
|
"request": "launch",
|
2023-05-29 15:11:02 +00:00
|
|
|
"webRoot": "${workspaceFolder}/apps/website",
|
2023-04-26 10:06:18 +00:00
|
|
|
"url": "http://localhost:3000",
|
|
|
|
"skipFiles": [
|
|
|
|
".next/**",
|
|
|
|
"${workspaceFolder}/node_modules/**",
|
|
|
|
"<node_internals>/**",
|
|
|
|
"**/webpack-internal://**"
|
|
|
|
],
|
|
|
|
"runtimeArgs": ["--auto-open-devtools-for-tabs"]
|
|
|
|
},
|
|
|
|
// todo: consider https://code.visualstudio.com/docs/editor/debugging#_compound-launch-configurations instead
|
|
|
|
// todo: consider client+prelaunch as full stack
|
2023-05-29 15:11:02 +00:00
|
|
|
// todo: consider workspaces https://code.visualstudio.com/docs/editor/multi-root-workspaces#_debugging
|
2023-04-26 10:06:18 +00:00
|
|
|
{
|
2023-05-29 15:11:02 +00:00
|
|
|
"name": "Launch Website via Next.js (full stack)",
|
2023-04-26 10:06:18 +00:00
|
|
|
"type": "node-terminal",
|
|
|
|
"request": "launch",
|
2023-05-29 15:11:02 +00:00
|
|
|
"cwd": "${workspaceFolder}/apps/website",
|
2023-04-26 10:06:18 +00:00
|
|
|
"command": "yarn dev -p 3000",
|
|
|
|
"serverReadyAction": {
|
|
|
|
"pattern": "started server on .+, url: (https?://.+)",
|
|
|
|
"action": "startDebugging",
|
2023-05-29 15:11:02 +00:00
|
|
|
"name": "Attach to Website via Next.js (client-side)",
|
2023-04-26 10:06:18 +00:00
|
|
|
"killOnServerStop": false
|
|
|
|
},
|
|
|
|
"skipFiles": [
|
|
|
|
".next/**",
|
|
|
|
"${workspaceFolder}/node_modules/**",
|
|
|
|
"<node_internals>/**"
|
|
|
|
]
|
2022-05-29 14:52:34 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|