robfig / plovr

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

[PATCH] Change sourcemap mapping to work like closure-compiler #86

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The source maps are hard to create. Example: `java -jar plovr.jar build 
--create_source_map ./mymap config1.js config2.js`

1. ./mymap might get overwritten but the second build
2. if we're using modules, it will create unhelpful mymap_<moduleid> filenames
3. it's hard to add the sourceMapURL to the generated .js files, the mapping is 
not straight-forward.

What solution do you propose ?

The attached diff changes the behavior as following:
1. %outfile% in the create_source_map path will get mapped to the current 
output file basename.
2. We stop appending the moduleid to the path in the module case.

You would then use plovr like that if you want the mapping: `java -jar 
plovr.jar build --create_source_map ./path/to/%outfile%.map config1.js 
config2.js`. It would generate files like config1_output.js.map. It's then easy 
to scan for these files to add the sourceMapURL.

What version of the product are you using? On what operating system?

HEAD

Original issue reported on code.google.com by jo...@pfenniger.name on 9 May 2013 at 3:06

Attachments: