June 2017
Intermediate to advanced
873 pages
18h 9m
English
On the web, the size of the JavaScript version of your app matters. For this reason, dart2js is optimized to produce the smallest possible JavaScript files.
When you're ready to deploy, minify the size of the generated JavaScript with –m or -- minify, as shown in the following command:
dart2js –m -o prorabbits.js prorabbits.dart
Using pub build on the command line minifies JavaScript by default because this command is meant for deployment.
The dart2js file utilizes a tree-shaking feature; only code that is necessary during execution is retained, that is, functions, classes, and libraries that are not called are excluded from the produced .js file. The minification process further reduces ...
Read now
Unlock full access