问题
I have a problem to set a breakpoint on a javascript source file minified mapped on real sources with a source map file.
The problem can be demonstrated with jquery.com website.
On this site, the imported script is jquery.min.js
which contains a //# sourceMappingURL=jquery.js
directive.
This can be observed on chromium 37 debugger :

On that "real source file", i'm trying to setup a breakpoint on line 500
, bug the breakpoint appears on line 6955
.
What is is wrong with this use case ? Is it possible to do this ?
回答1:
This could happen when the line you set breakpoint to does not have proper mapping to the compiled source code. I have checked and indeed this line is mapped to some weird (unexisiting) position in the jqeury.min.js file.
Consider filing this as a JQuery issue. Please note, however, that while in the most recent versions of jquery source map url is not included in the minified version by default, you can still download it from their site and check if this was fixed.
来源:https://stackoverflow.com/questions/26212796/cant-set-breakpoint-in-source-mapped-file-example-with-jquery