简体   繁体   English

WebStorm调试不适用于Webpack和grunt

[英]WebStorm debug not working with Webpack and grunt

I have the debugger running and It seems to work on first load as it hits breakpoints. 我正在运行调试器,并且它在遇到断点时似乎可以在首次加载时工作。 However, as the user takes actions, the breakpoints are no longer hit. 但是,随着用户采取行动,断点将不再起作用。

I have this (notice how the line numbers are different. I'm guessing the minified/concat files of my actual JS doesn't match the files I'm debugging but I don't know how to change them) 我有这个(注意行号有何不同。我猜我的实际JS的缩小/合并文件与我调试的文件不匹配,但我不知道如何更改它们)

在此处输入图片说明

but the console shows it on a different line for my log statement: 但是控制台在我的log语句的另一行显示了它:

在此处输入图片说明

However, every time I try to debug, I miss the break point even though WebStorm sees the console messages in the debug console tool. 但是,每次尝试调试时,即使WebStorm在调试控制台工具中看到了控制台消息,我也会错过断点。

How can I debug code that is minified? 如何调试缩小的代码?

I did find the way to make this work in the end and it had to do with my sourcemaps for webpack. 我确实找到了最终完成这项工作的方法,这与我的webpack源映射有关。 Because I was building a different directory, I had to point it to my build dir rather than my actual code for the webpack///./ 因为我正在构建其他目录,所以必须将其指向构建目录,而不是webpack ///./的实际代码。

http://puu.sh/pzyhA/ef2af3a74e.png http://puu.sh/pzyhA/ef2af3a74e.png

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM