diff --git a/pkg/dev_compiler/lib/src/codegen/js_printer.dart b/pkg/dev_compiler/lib/src/codegen/js_printer.dart index 2e9080b42cd..021678f2a59 100644 --- a/pkg/dev_compiler/lib/src/codegen/js_printer.dart +++ b/pkg/dev_compiler/lib/src/codegen/js_printer.dart @@ -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();