What happens when you’ve got an error occurring only in the minified version of your Dojo application?
Introducing Source Maps
There’s an fantastic overview of the technology here, showing you how to enable support in your browser and generate the necessary files using Google’s Closure compiler.
Generating Source Maps For Dojo
The Dojo Toolkit’s build system supports using the Closure compiler for minification, making it an obvious next step to enable automatic generation of source mappings. Working on this over the weekend, I’ve been able to enhance the build system to generate source maps for each layer file when using the following command line parameter.
$ sh build.sh bin=node action=release profile=my_profile layerOptimize=closure
For more details on the implementation, along with the patch, see the associated ticket that’s been opened to track adding this feature into Dojo.
When you’ve enabled source maps in your browser, switching to the scripts tab in Chrome’s Developer Tools now displays the unminified versions of any built layer files. This can be seen in action on the following page.
Please note, this feature is only enabled when using NodeJS as the build runtime and requires an upgrade of the Closure compiler to the latest version.