dart-lang / dart-lang/webdev

dart.vm.product is not set to true in --release builds

Open
#1,739 1 comment 0 reactions 0 assignees View on GitHub
P3 triaged
Dominant language
Dart
Stars
224
Forks
94
Avg merge
7h 14m
Merged PRs (30d)
2

Description

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. :)

Contributor guide

Open the contributing guide

Research direction

Start with the webdev build --release entry point and compare its behavior with Flutter's linked packages/flutter_tools/lib/src/compile.dart implementation. Done means release web builds set dart.vm.product to true, or provide an equivalent documented way to detect release mode.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
build-system, cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.