Skip to content

Commit 292496f

Browse files
authored
[tools, web] Make sure to copy the dump-info file if dump-info is used (#165013)
Also fixed the wording of the dump-info build flag
1 parent 81139db commit 292496f

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

packages/flutter_tools/lib/src/build_system/targets/web.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,12 @@ class Dart2JSTarget extends Dart2WebTarget {
252252
return true;
253253
}
254254
}
255+
256+
if (compilerConfig.dumpInfo) {
257+
if (file.basename == 'main.dart.js.info.json') {
258+
return true;
259+
}
260+
}
255261
return false;
256262
});
257263

packages/flutter_tools/lib/src/commands/build_web.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class BuildWebCommand extends BuildSubCommand {
9595
negatable: false,
9696
help:
9797
'Passes "--dump-info" to the Javascript compiler which generates '
98-
'information about the generated code is a .js.info.json file.',
98+
'information about the generated code in main.dart.js.info.json.',
9999
);
100100
argParser.addFlag(
101101
'no-frequency-based-minification',

packages/flutter_tools/test/general.shard/build_system/targets/web_test.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,18 @@ name: foo
227227
..createSync(recursive: true)
228228
..writeAsStringSync('A');
229229
environment.buildDir.childFile('main.dart.js').createSync();
230+
environment.buildDir.childFile('main.dart.js.info.json').createSync();
230231
environment.buildDir.childFile('main.dart.js.map').createSync();
231232
environment.buildDir.childFile('main.dart.js_1.part.js').createSync();
232233
environment.buildDir.childFile('main.dart.js_1.part.js.map').createSync();
233234

234-
await WebReleaseBundle(<WebCompilerConfig>[const JsCompilerConfig()]).build(environment);
235+
await WebReleaseBundle(<WebCompilerConfig>[
236+
const JsCompilerConfig(dumpInfo: true),
237+
]).build(environment);
235238

236239
expect(environment.outputDir.childFile('foo.txt').readAsStringSync(), 'A');
237240
expect(environment.outputDir.childFile('main.dart.js').existsSync(), true);
241+
expect(environment.outputDir.childFile('main.dart.js.info.json').existsSync(), true);
238242
expect(environment.outputDir.childFile('main.dart.js.map').existsSync(), true);
239243
expect(environment.outputDir.childFile('main.dart.js_1.part.js').existsSync(), true);
240244
expect(environment.outputDir.childFile('main.dart.js_1.part.js.map').existsSync(), true);

0 commit comments

Comments
 (0)