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?
Build better web apps The web itself is a flexible platform, but Flutter is ideal for building web applications like PWAs or SPAs and bringing your existing mobile app to the web.
Flutter comes with the added advantage of web support as a PWA. With this, we can create a PWA of the mobile application that will run smoothly in the browser.
Debug mode for a web app means that: The build is not minified and tree shaking has not been performed. The app is compiled with the dartdevc compiler for easier debugging. By default, flutter run compiles to debug mode.
Build an app with web support. Add web support to an existing project. To create a Flutter app with web support, you need the following software: Flutter SDK. See the Flutter SDK installation instructions. Chrome; debugging a web app requires the Chrome browser. Optional: An IDE that supports Flutter.
But Flutter doesn’t do that. Instead of compiling the whole code again and again. Flutter team divides the compilation phase into three modes. First mode when you are developing the app, second mode when you are testing the performance of the app and third and the last mode is when you release the app.
But if you want to switch to release mode , Use this command for running your app flutter run --release. or In Android Studio , click on : > Run. > Flutter Run 'main.dart' in Release Mode. Share. Improve this answer.
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
There's an issue on github for this feature, feel free to upvote ;)
https://github.com/flutter/flutter/issues/96283
The only way I have found to do this is to use flutter run -d chrome
. We would then need to locate where the files on disk are located.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With