I have this code:
// main.dart
import "package:angular/angular.dart";
main () => ngBootstrap();
I make dart2js --minify --out=main.dart.js main.dart
Then i have main.dart.js with size 2.6 MiB (2,744,320 bytes). It is not normal. What i'm doing wrong?
Is angular.dart usable for production at this stage?
Minification can help reduce JavaScript file sizes by removing comments, white spaces, and redundant code, and in some cases, also makes the code more efficient by using shorter variable and function names. The smaller these JavaScript files are, the faster they are downloaded, parsed, and executed by the browser.
URLs contain JavaScript files of size over 25 KB. The figure of 25KB is relatively arbitrary – there is no hard and fast rule as to what constitutes an JavaScript file that is 'too large'.
Javascript code can be compressed in one or more of the following ways: By removing white spaces and indentation. By shortening variable names to single characters. By removing new line characters.
How much does JS bundle size really matter? Simply put, JavaScript bundle size matters a lot. From some of the folks that help steer the ship: Companies with high-traffic applications save millions of dollars by tweaking and optimizing their performance.
@media-slave24
Maybe this will be helpful for You: https://code.google.com/p/dart/issues/detail?id=14686
It's reported on dart bug tracking system. Some people using mirrors got 760kb. So it's definitely a bug.
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