The source maps served by Plovr could be made more useful in a couple ways.
By including the "X-SourceMap" header in the compiled source response, clients
that support source maps can request the source map.
The "sources" member in the source map generated by Closure Compiler do not map
to the paths where Plovr serves the source files. Ideally, the "sourceRoot"
could be configured, but it doesn't appear that the Source Map v3 generator
supports this (see
http://code.google.com/p/closure-compiler/issues/detail?id=770).
As a workaround for the missing "sourceRoot," the source map location mappings
option can be set on the compiler. Whereas before the "sources" member in a
source map might have looked like the following:
"sources": ["/closure/goog/base.js", "app.js"]
It would now look like this:
"sources": ["/input/{id}//closure/goog/base.js", "/input/{id}/app.js"]
Where {id} is replaced by the config id.
I couldn't find a good place to write tests for this, but with these changes
(http://codereview.appspot.com/6346071/),
source maps from Plovr work for me in Chrome.
Original issue reported on code.google.com by tim.sch...@gmail.com on 10 Jul 2012 at 9:22
Original issue reported on code.google.com by
tim.sch...@gmail.com
on 10 Jul 2012 at 9:22