RC-Paves3-build / plovr

Automatically exported from code.google.com/p/plovr
0 stars 0 forks source link

Improvements to source maps #70

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
for this one, patch seems ok.

Original comment by dusan.ma...@gmail.com on 17 Jul 2012 at 11:13