Launch.json code

From Seedbury Square
Revision as of 13:23, 5 January 2026 by Mgm-seedbury (talk | contribs) (Created page with "{ "version": "0.2.0", "configurations": [ →‎--- Server (Node.js) ---: { "name": "Server: Node (inspect)", "type": "pwa-node", "request": "launch", "program": "${workspaceFolder}/api/src/webServer/webserver.js", "cwd": "${workspaceFolder}/api/src/webServer", "runtimeArgs": [ "--inspect=9229" ], "env": { "NODE_ENV": "development"...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

{

  "version": "0.2.0",
  "configurations": [
      /* --- Server (Node.js) --- */
      {
          "name": "Server: Node (inspect)",
          "type": "pwa-node",
          "request": "launch",
          "program": "${workspaceFolder}/api/src/webServer/webserver.js",
          "cwd": "${workspaceFolder}/api/src/webServer",
          "runtimeArgs": [
              "--inspect=9229"
          ],
          "env": {
              "NODE_ENV": "development"
          },
          "skipFiles": [
              "<node_internals>/**"
          ],
          "console": "integratedTerminal",
          "restart": true, // auto-restart on crash
          "autoAttachChildProcesses": true
          // If using TypeScript/transpiled output, add:
          // "outFiles": ["${workspaceFolder}/**/*.js", "!**/node_modules/**"]
      },
      /* --- Browser (Chrome) --- */
      {
          "name": "Client: Chrome to http://localhost:1338",
          "type": "pwa-chrome",
          "request": "launch",
          "url": "http://localhost:1338",
          "webRoot": "${workspaceFolder}",
          // If your app bundles sources (Vite/Webpack), uncomment to improve breakpoint mapping:
          // "sourceMapPathOverrides": {
          //   "webpack:///./*": "${webRoot}/*",
          //   "webpack:///*":   "${webRoot}/*",
          //   "vite:///src/*":  "${webRoot}/src/*"
          // }
          "skipFiles": [
              "**/node_modules/**/*.js"
          ]
      },
      /* --- Optional: Node with nodemon (hot reload) --- */
      {
          "name": "Server: Node + nodemon (inspect)",
          "type": "pwa-node",
          "request": "launch",
          "runtimeExecutable": "npx",
          "runtimeArgs": [
              "nodemon",
              "--"
          ], // <-- 'nodemon' + '--' are the key
          "args": [
              "--inspect=9229",
              "--signal",
              "SIGTERM",
              "${workspaceFolder}/api/src/webServer/webserver.js"
          ],
          "cwd": "${workspaceFolder}/api/src/webServer",
          "env": {
              "NODE_ENV": "development"
          },
          "restart": true,
          "console": "integratedTerminal",
          "autoAttachChildProcesses": true
      },
      /* --- Optional: attach to an already-running Node --- */
      {
          "name": "Attach: Node on 9229",
          "type": "pwa-node",
          "request": "attach",
          "port": 9229
      },
      {
          "name": "Client: Chrome via BrowserSync",
          "type": "pwa-chrome",
          "request": "launch",
          "url": "http://localhost:3000",
          "webRoot": "${workspaceFolder}/api/src/webServer/ui",
          "skipFiles": [
              "**/node_modules/**/*.js"
          ],
          "preLaunchTask": "browser-sync" // <- if compound preLaunchTask isn't honored, keep it here
      }
  ],
  "compounds": [
      {
          "name": "Dev: Nodemon + BrowserSync + Chrome",
          "configurations": [
              "Server: Node + nodemon (inspect)",
              "Client: Chrome via BrowserSync"
          ],
          "preLaunchTask": "browser-sync",
          "stopAll": true
      },
      {
          "name": "Dev: Server + Browser",
          "configurations": [
              "Server: Node (inspect)",
              "Client: Chrome to http://localhost:1338"
          ],
          "stopAll": true
      },
      {
          "name": "Dev: Nodemon + Browser",
          "configurations": [
              "Server: Node + nodemon (inspect)",
              "Client: Chrome to http://localhost:1338"
          ],
          "stopAll": true
      }
  ]

}