Skip to content

Commit

Permalink
Use -O2 optimization for DevTools wasm build. (#8814)
Browse files Browse the repository at this point in the history
  • Loading branch information
kenzieschmoll authored Jan 28, 2025
1 parent 80b0762 commit 80bbb54
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tool/build_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ flutter pub get
flutter build web \
--source-maps \
--wasm \
-O2 \
--dart2js-optimization=O4 \
--pwa-strategy=offline-first \
--release \
--no-tree-shake-icons
Expand Down
8 changes: 7 additions & 1 deletion tool/lib/commands/build.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,13 @@ class BuildCommand extends Command {
] else ...[
// Do not minify stack traces in debug mode.
if (buildMode == 'debug') '--dart2js-optimization=O1',
if (buildMode != 'debug') '--$buildMode',
if (buildMode != 'debug') ...[
'--$buildMode',
// Use -O2 optimization by default (sound dart) but override for
// dart2js with -O4 (it's too slow otherwise).
'-O2',
'--dart2js-optimization=O4',
],
],
'--pwa-strategy=offline-first',
'--no-tree-shake-icons',
Expand Down

0 comments on commit 80bbb54

Please sign in to comment.