Skip to content

Commit 2c56a25

Browse files
authored
[tool] Improve help info with build web --wasm flags (#125907)
Also fixed some comments
1 parent 0f9d66a commit 2c56a25

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,16 @@ class BuildWebCommand extends BuildSubCommand {
9898
);
9999
argParser.addFlag(
100100
'omit-type-checks',
101-
help: 'Omit type checks in Wasm output.',
101+
help: 'Omit type checks in Wasm output.\n'
102+
'Reduces code size and improves performance, but may affect runtime correctness. Use with care.',
102103
negatable: false,
103104
hide: !featureFlags.isFlutterWebWasmEnabled,
104105
);
105106
argParser.addFlag(
106107
'wasm-opt',
107-
help: 'Run wasm-opt on the output wasm module.',
108+
help:
109+
'Optimize output wasm using the Binaryen (https://github.com/WebAssembly/binaryen) tool.\n'
110+
'Increases the build time, but will yield a smaller, faster output.',
108111
negatable: false,
109112
hide: !featureFlags.isFlutterWebWasmEnabled,
110113
);

packages/flutter_tools/lib/src/web/compiler_config.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,16 @@ class WasmCompilerConfig extends WebCompilerConfig {
147147
runWasmOpt: defines[kRunWasmOpt] == 'true',
148148
);
149149

150-
/// Build environment for [omitTypeChecks];
150+
/// Build environment for [omitTypeChecks].
151151
static const String kOmitTypeChecks = 'WasmOmitTypeChecks';
152+
153+
/// Build environment for [runWasmOpt].
152154
static const String kRunWasmOpt = 'RunWasmOpt';
153155

154156
/// If `omit-type-checks` should be passed to `dart2wasm`.
155157
final bool omitTypeChecks;
156158

157-
// Run wasm-opt on the resulting module.
159+
/// Run wasm-opt on the resulting module.
158160
final bool runWasmOpt;
159161

160162
@override

0 commit comments

Comments
 (0)