mirror of
https://github.com/flutter/flutter
synced 2024-07-16 10:29:14 +00:00
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:
parent
ea1ef751e0
commit
074114b85a
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue