Closed walsha2 closed 3 months ago
Yes there is an option for dart2js to optimize the generated js, specifically there are four levels of optimization.
It makes sense to expose this as an option to jaspr build
as well as pick a reasonable default
This is a good issue for a first contribution if you like 😁✌️
Description
@schultek It looks like there is some considerable savings that can be made by simply minifying the resulting, compiled, JS files from
dart2js
. This would reduce the time taken to render an SSR app as this, rather large, un-minified JS is being sent by the server, namelyapp.client.dart.js
The following were generated using
jaspr build
(Jaspr CLI (Version 0.10.0)
) for a relatively small app with just a couple screens.Before Minification
After Minification
Additional Context
https://dart.dev/tools/webdev#build
I was under the assumption that
webdev build
and/ordart2js
would minify the JS by default, no? Not sure why that is not happening here or if the option is not enabled.Related
Maybe even something to minify the CSS? Although I understand if this should be an outside tool and up to the user.