Unverified Commit 074114b8 authored by Jackson Gardner's avatar Jackson Gardner Committed by GitHub

Copy over source maps from dart2js target when they are enabled. (#144832)

This fixes https://github.com/flutter/flutter/issues/143703

We need to make sure that when source maps are enabled for the dart2js target, it advertises the sourcemap file as one of its outputs so that the web release bundle can copy it over.
parent ea1ef751
...@@ -231,6 +231,7 @@ class Dart2JSTarget extends Dart2WebTarget { ...@@ -231,6 +231,7 @@ class Dart2JSTarget extends Dart2WebTarget {
@override @override
List<String> get buildFiles => <String>[ List<String> get buildFiles => <String>[
'main.dart.js', 'main.dart.js',
if (compilerConfig.sourceMaps) 'main.dart.js.map',
]; ];
} }
......
...@@ -182,6 +182,7 @@ void main() { ...@@ -182,6 +182,7 @@ void main() {
webResources.childFile('foo.txt') webResources.childFile('foo.txt')
.writeAsStringSync('A'); .writeAsStringSync('A');
environment.buildDir.childFile('main.dart.js').createSync(); environment.buildDir.childFile('main.dart.js').createSync();
environment.buildDir.childFile('main.dart.js.map').createSync();
await WebReleaseBundle(<WebCompilerConfig>[ await WebReleaseBundle(<WebCompilerConfig>[
const JsCompilerConfig() const JsCompilerConfig()
...@@ -191,6 +192,8 @@ void main() { ...@@ -191,6 +192,8 @@ void main() {
.readAsStringSync(), 'A'); .readAsStringSync(), 'A');
expect(environment.outputDir.childFile('main.dart.js') expect(environment.outputDir.childFile('main.dart.js')
.existsSync(), true); .existsSync(), true);
expect(environment.outputDir.childFile('main.dart.js.map')
.existsSync(), true);
expect(environment.outputDir.childDirectory('assets') expect(environment.outputDir.childDirectory('assets')
.childFile('AssetManifest.bin.json').existsSync(), true); .childFile('AssetManifest.bin.json').existsSync(), true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment