Friday, July 20, 2012

ProTip: Debugging Minified JavaScript using Chrome DevTools

Here's yet another reason why I develop exclusively in Chrome: they've got a killer feature in the JavaScript DevTools which will format any script file, even if it's been minified, and allow you to place breakpoints on that formatted output!

If you're working on troubleshooting an issue in a production app, for example, you'll have something like this:


If you notice, there's a button on the bottom toolbar that looks like a pair of curly braces { }. If you click that:


Then voila! Pretty-printed!


And I can set breakpoints and troubleshoot!


No comments: