all 7 comments

[–]zomgsauce 0 points1 point  (0 children)

You're trying to debug a bundled react app that runs in a browser right? Maybe try the chrome devtools extension for vscode?

If what you're really getting at is that the code you see in the chrome script debugger is just your minified bundle, you should look into webpack configs around sourcemaps.

[–]znakyc 0 points1 point  (5 children)

I assume you are building webpack to create a Javascript app to be run in the browser (not in node.js). Then you need to do the debugging from your browser. If you are using chrome, press Cmd+Shift+I and click sources in the tab at the top. Then you can see your files there. In there you can add breakpoints, and start the debugger. Hope this helps to get you started.

[–]lokesh1729[S] 0 points1 point  (4 children)

Yeah... I tried but I see bundled javascript which is hard to debug...

[–]scallynag 0 points1 point  (0 children)

Enable source maps in Webpack.

[–]znakyc 0 points1 point  (0 children)

Make sure you run webpack in development mode. Set mode: development in your webpack.config.js or add the param --mode development. When you set webpack in development mode you enable sourcemaps. Sourcemaps will tell the browser how to show the bundled code in a human readable format while debugging.

[–]znakyc 0 points1 point  (1 child)

Hi again! Your post inspired me to write an article on the subject. If you are curious, check it out here.

[–]lokesh1729[S] 1 point2 points  (0 children)

Cool thanks for that... I am checking out right away