在webpack-dev-server npm脚本进程

时间:2018-04-25 07:57:39

标签: node.js debugging webpack visual-studio-code

我正在尝试调试运行npm startnpm run-script debug时出错的节点模块。

这些是 package.json

中的脚本
  "scripts": {
    "start": "webpack-dev-server --port 9229 --env.mode development",
    "debug": "webpack-dev-server --port 9229 --env.mode development",
    "test": "echo \"Error: no test specified\" && exit 1"
  },

并在VS Code的 launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch via NPM",
            "type": "node",
            "request": "launch",
            "cwd": "${workspaceFolder}",
            "runtimeExecutable": "npm",
            "runtimeArgs": [
                "run-script", "debug"
            ],
            "port": 9229
        }
    ]
}

当我开始调试时,它不会中断我在 webpack.config.js node_modules 中设置的任何断点,但它会输出错误我是进入VS Code的调试控制台。

0 个答案:

没有答案