Skip to content

Commit

Permalink
more compact source map format
Browse files Browse the repository at this point in the history
  • Loading branch information
devoncarew committed Nov 16, 2015
1 parent 1d85f2e commit 0cbc2ff
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/dev_compiler/lib/src/codegen/js_printer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ String writeJsLibrary(JS.Program jsTree, String outputPath,
text = printer.text;
var sourceMap = JSON.decode(printer.map);
var sourceMapText = new JsonEncoder.withIndent(' ').convert(sourceMap);
// Convert:
// "names": [
// "state",
// "print"
// ]
// to:
// "names": ["state","print"]
sourceMapText =
sourceMapText.replaceAll('\n ', '').replaceAll('\n ]', ']');
new File('$outputPath.map').writeAsStringSync('$sourceMapText\n');
} else {
text = (context as JS.SimpleJavaScriptPrintingContext).getText();
Expand Down

0 comments on commit 0cbc2ff

Please sign in to comment.