Parcel 和 Vanilla JS 的 VSCode 中的 launch.json

launch.json in vscode for parcel and vanilla js

提问人:lhnaseeb 提问时间:8/1/2023 最后编辑:phuzilhnaseeb 更新时间:8/1/2023 访问量:23

问:

我正在尝试调试我正在处理的程序,但我无法让 launch.json 工作以便绑定我的断点。我正在将包裹用于服务器。一切都在根目录中。我想从 index.js 运行我的程序。我很困惑,非常感谢您的帮助。我附上了我的文件目录的屏幕截图,我将在下面发布我的 launch.json 和 package.json。谢谢!

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "skipFiles": [
                "<node_internals>/**"
            ],
            "program": "${workspaceFolder}\\index.js"
        }
    ]
}

launch.json文件

{
  "name": "dumbed-down-pacman",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "parcel index.html",
    "build": "parcel build index.html",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "Laila Naseeb",
  "license": "ISC",
  "devDependencies": {
    "@babel/core": "^7.22.5",
    "@babel/plugin-transform-runtime": "^7.22.5",
    "parcel": "^2.9.2"
  }
}

package.json

我尝试将预构建的 launch.json 用于 node 和 chrome,但它们都不起作用。我的断点不会绑定。它会指出我把断点放在哪里,但它找不到文件。

JavaScript 节点 .js 调试 ParcelJS

评论


答: 暂无答案