Skip to content

Commit

Permalink
Enable compression for packaged zip (.foxe) files (#147)
Browse files Browse the repository at this point in the history
JSZip default "compression" is STORE, you need to enable DEFLATE
explicitly. See
<https://stuk.github.io/jszip/documentation/api_jszip/generate_async.html#compression-and-compressionoptions-options>
  • Loading branch information
jhurliman authored Jul 30, 2024
1 parent 81ed006 commit 9d7d66c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ async function writeFoxe(baseDir: string, files: string[], outputFile: string):
info(`Writing archive to ${outputFile}`);
return await new Promise((c, e) => {
zip
.generateNodeStream({ type: "nodebuffer", streamFiles: true })
.generateNodeStream({ type: "nodebuffer", streamFiles: true, compression: "DEFLATE" })
.pipe(createWriteStream(outputFile, { encoding: "binary" }) as NodeJS.WritableStream)
.on("error", e)
.on("finish", c);
Expand Down

0 comments on commit 9d7d66c

Please sign in to comment.