forked from firka/flutter
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.
This commit is contained in:
@@ -231,6 +231,7 @@ class Dart2JSTarget extends Dart2WebTarget {
|
||||
@override
|
||||
List<String> get buildFiles => <String>[
|
||||
'main.dart.js',
|
||||
if (compilerConfig.sourceMaps) 'main.dart.js.map',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -182,6 +182,7 @@ void main() {
|
||||
webResources.childFile('foo.txt')
|
||||
.writeAsStringSync('A');
|
||||
environment.buildDir.childFile('main.dart.js').createSync();
|
||||
environment.buildDir.childFile('main.dart.js.map').createSync();
|
||||
|
||||
await WebReleaseBundle(<WebCompilerConfig>[
|
||||
const JsCompilerConfig()
|
||||
@@ -191,6 +192,8 @@ void main() {
|
||||
.readAsStringSync(), 'A');
|
||||
expect(environment.outputDir.childFile('main.dart.js')
|
||||
.existsSync(), true);
|
||||
expect(environment.outputDir.childFile('main.dart.js.map')
|
||||
.existsSync(), true);
|
||||
expect(environment.outputDir.childDirectory('assets')
|
||||
.childFile('AssetManifest.bin.json').existsSync(), true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user