How to build flutter web app in debug mode?

Issue

flutter build web will build my flutter app with obfuscation and minification.

I want my error stack to be readable though.

How should I modify the command?

Solution

Try:

flutter build web --profile --dart-define=Dart2jsOptimization=O0

See:

https://github.com/flutter/flutter/blob/720dff6a94bd054e82ec4bf84b5cb802bbc52ddd/packages/flutter_tools/lib/src/build_system/targets/web.dart#L238-L239

Answered By – djpeinado

Answer Checked By – David Goodson (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *