With the fantastic addition in #1977 we're very close to switching our build pipeline away from rollup + terser over to esbuild. The speed improvement of esbuild is crazy good! Our current setup takes 4.8s and esbuild only 0.1s 🎉
Being a little obsessed with output size in the Preact team, the generated code by terser remains a little smaller.
esbuild: 4810 B (gzipped)
current: 4677 B (gzipped)
Comparing the generated output of both tools it seems to be mainly caused by terser being able to inline constant variables.
Example input:
const a = 1 << 1;
console.log(a);
esbuild output:
const a=1<<1;console.log(a);
Terser output:
Here is the full output comparison of the Preact source: https://gist.github.com/marvinhagemeister/41a1b779650d335550eac7f5a825031f
With the fantastic addition in #1977 we're very close to switching our build pipeline away from rollup + terser over to esbuild. The speed improvement of esbuild is crazy good! Our current setup takes 4.8s and esbuild only 0.1s 🎉
Being a little obsessed with output size in the Preact team, the generated code by terser remains a little smaller.
Comparing the generated output of both tools it seems to be mainly caused by terser being able to inline constant variables.
Example input:
esbuild output:
Terser output:
Here is the full output comparison of the Preact source: https://gist.github.com/marvinhagemeister/41a1b779650d335550eac7f5a825031f