You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we check the dart compile js help section, we can see it supports optmization levels:
dart compile js --help
Compile Dart to JavaScript.
Usage: dart compile js [arguments]
-h, --help Print this usage information.
-h -v Show detailed information about all options.
-o, --output Write the output to .
-O<0,1,2,3,4> Set the compiler optimization level (defaults to -O1).
-O0 No optimizations (only meant for debugging the compiler).
-O1 Default (includes whole program analyses and inlining).
-O2 Safe production-oriented optimizations (like minification).
-O3 Potentially unsafe optimizations (see -h -v for details).
-O4 More agressive unsafe optimizations (see -h -v for details).
However, if we check the webdev build help section, we can see it doesn't show anything related to these flags:
webdev build --help
Run builders to build a package.
Usage: webdev build [arguments]
-h, --help Print this usage information.
-o, --output A directory to write the result of a build to. Or a mapping from a top-level
directory in the package to the directory to write a filtered build output
to. For example "web:deploy".
A value of "NONE" indicates that no "--output" value should be passed to build_runner.
(defaults to "web:build")
-r, --[no-]release Build with release mode defaults for builders.
(defaults to on)
--[no-]build-web-compilers If a dependency on build_web_compilers is required to run.
(defaults to on)
-e, --[no-]enable-expression-evaluation Enable expression evaluation features in the debugger.
(defaults to on)
-v, --verbose Enables verbose logging.
Run "webdev help" to see global options.
If we try to pass the optimization level anyway, it doesn't work:
webdev build -O2
Could not find an option with short name "-O".
Usage: webdev build [arguments]
...
Another alternative I tried is webdev build -- -O2, but it doesn't work too:
Should webdev's documentation enforce "You can use any option available to dart compile js with webdev build." if the relevant flags don't work? I guess so, it should work.
The text was updated successfully, but these errors were encountered:
Hi!
The documentation in https://dart.dev/web/deployment says:
If we check the
dart compile js
help section, we can see it supports optmization levels:However, if we check the
webdev build
help section, we can see it doesn't show anything related to these flags:If we try to pass the optimization level anyway, it doesn't work:
Another alternative I tried is
webdev build -- -O2
, but it doesn't work too:Should webdev's documentation enforce "You can use any option available to dart compile js with webdev build." if the relevant flags don't work? I guess so, it should work.
The text was updated successfully, but these errors were encountered: