2

I would like to debug the webpack scripts , not the produced app !

How can I configure the build scripts to be launched / used by a node debugger such as devtool ?

1 Answer 1

2

The webpack binary you run is just JavaScript, so you can debug it like any other script you run. When you install webpack, a symlink ./node_modules/.bin/webpack is added that refers to webpack.js. You can run the node debugger with:

node debug ./node_modules/.bin/webpack [options]

Or if you want to use Chrome devtools you add the --inspect flag:

node debug --inspect ./node_modules/.bin/webpack [options]
Sign up to request clarification or add additional context in comments.

1 Comment

I would add just that your config might be node debug ./node_modules/.bin/webpack [options] as in my case (Windows, webpack 3) ./node_modules/.bin/webpack leads to an error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.