Open thomastay opened 2 years ago
Consider: making terser configurable in tools/configure.js
Here's a trace of the tasks that have to run from a nearly clean build, assuming that bin/build.exe is already built (if not it dominates the timing diagram)
As you can see, the time taken by terser is quite significant, and adds about 600ms in this run.
Here is the trace without terser:
Basically, there is about 450 - 500ms unavoidable wait before index.html can be built, since we have to wait for the SSR content to be built.
However, terser can be really slow, and even accounting for that, can still add an additional 500-600ms to the build.
Currently just running it on esbuild's already minified output. Not sure if this is the best approach, may change to different bundle strategy.
Saves 150b gzipped, 500b minified. Quite significant, terser really is a work of art.
However, this adds about 500 or so ms to incremental build time. Before this, build time was ~200ms, now it is ~700ms, which is approaching the threshold of 1s.
Edit: found some more terser options which changes 120b saved -> 150 bytes saved