Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Too large JS-file generated

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?

like image 988
media-slave24 Avatar asked Nov 21 '13 11:11

media-slave24


People also ask

How do I reduce the size of a JavaScript file?

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.

How big is too big for JS file?

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'.

Can you compress JavaScript files?

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.

Does JavaScript size matter?

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.


1 Answers

@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.

like image 115
galuszkak Avatar answered Sep 29 '22 04:09

galuszkak