Skip to content

Commit 885f10e

Browse files
Don't minify stack traces when building in debug mode (#7587)
1 parent f17c50b commit 885f10e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tool/lib/commands/build.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ import '../utils.dart';
1616
///
1717
/// By default, this command builds DevTools in release mode, but this can be
1818
/// overridden by passing 'debug' or 'profile' as the
19-
/// [BuildCommandArgs.buildMode] argument.
19+
/// [BuildCommandArgs.buildMode] argument. For testing embedded content in
20+
/// VS Code, 'profile' or the default 'release' mode must be used because
21+
/// the '--dart2js-optimization=O1' flag that is passed for 'debug' builds
22+
/// will cause issues with the VS Code embedding.
2023
///
2124
/// If the [BuildCommandArgs.useFlutterFromPath] argument is present, the
2225
/// Flutter SDK will not be updated to the latest Flutter candidate before
@@ -84,7 +87,7 @@ class BuildCommand extends Command {
8487
workingDirectory: repo.devtoolsAppDirectoryPath,
8588
);
8689

87-
logStatus('building DevTools in release mode');
90+
logStatus('building DevTools in $buildMode mode');
8891
await processManager.runAll(
8992
commands: [
9093
if (runPubGet) CliCommand.tool(['pub-get', '--only-main']),
@@ -95,6 +98,8 @@ class BuildCommand extends Command {
9598
'--web-renderer',
9699
'canvaskit',
97100
'--pwa-strategy=offline-first',
101+
// Do not minify stack traces in debug mode.
102+
if (buildMode == 'debug') '--dart2js-optimization=O1',
98103
if (buildMode != 'debug') '--$buildMode',
99104
'--no-tree-shake-icons',
100105
],

0 commit comments

Comments
 (0)