Skip to content

Commit

Permalink
Improve compression when publishing package
Browse files Browse the repository at this point in the history
Increasing the number of iterations shaves off several more bytes.
  • Loading branch information
EvanHahn committed Sep 28, 2024
1 parent 70660df commit 1903fc0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion build/build-package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ async function postPackCrush(originalTarGz: string): Promise<string> {
const crushedTarGz = originalTarGz.replace(".tgz", ".crushed.tgz");
const readOriginal = fsOriginal.createReadStream(originalTarGz);
const gunzip = zlib.createGunzip();
const gzip = zopfli.createGzip({ numiterations: 15 });
const gzip = zopfli.createGzip({ numiterations: 100 });
const writeCrushed = fsOriginal.createWriteStream(crushedTarGz);

await pipe(readOriginal, gunzip, gzip, writeCrushed);
Expand Down

0 comments on commit 1903fc0

Please sign in to comment.