IntelliJ IDEA:如何创建调试webpack的断点?

时间:2016-08-06 03:06:37

标签: node.js intellij-idea webpack javascript-debugger

使用Intellij IDEA的调试工具到webpack,

OS:MAC

npm脚本:

"scripts": {
    "dev": " webpack-dev-server --inline --hot --display-error-details  --content-base   --config mvvm/build/webpack.dev.conf.js",
}

它提示:

To debug "build-distributor" script, make sure $NODE_DEBUG_OPTION string is specified as the first argument for node command you'd like to debug.

 For example:

{ "start": "node $NODE_DEBUG_OPTION server.js" }

问题:

在哪里添加此代码($ NODE_DEBUG_OPTION)?

1 个答案:

答案 0 :(得分:0)

Package.json配置

首先,您必须创建一个新的调试脚本,如下所示:

"debug": "node $NODE_DEBUG_OPTION node_modules/.bin/webpack-dev-server --config ./path/to/webpack.config.js"

webpack配置

您必须添加以下命令行:

devtool: 'eval-source-map'

编辑器配置

,然后您必须配置您的IDE: enter image description here 还有这个: enter image description here