Open eseidel opened 2 years ago
Adding a build.yaml with:
targets:
$default:
builders:
build_web_compilers:entrypoint:
release_options:
dart2js_args:
- '-Ddart.vm.product=true'
appears to be the necessary magic. :)
Flutter seems to have landed on using dart.vm.product to indicate release mode.
https://api.flutter.dev/flutter/foundation/kReleaseMode-constant.html
How Flutter sets it: https://github.com/flutter/flutter/blob/b7c500fc6bf04e44156722cd053020595d1fbd35/packages/flutter_tools/lib/src/compile.dart#L197
I was looking for something similar for "dart web" builds, and failed to find such. Would be nice if the Flutter way worked for
webdev build --release
or at least if some way worked. :)