Using Source Maps

When CoffeeScript was first released in 2009, source maps were but a twinkle in some Google engineers’ eyes. The problem of debugging obfuscated JavaScript has existed ever since the dawn of web development, thanks to minification. Google decided to try to tackle the problem in their minification tool, Closure Compiler, by creating metadata called source maps that their Closure Inspector tool could parse. This metadata allowed pieces of minified code to be mapped to the original source code during debugging. In 2011, Google moved to add source maps to the debugging tools in WebKit, the engine underlying Safari and Chrome. (Google would later fork WebKit into a new engine called Blink.) Mozilla and Microsoft followed their lead. ...

Get CoffeeScript, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.