Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pnpm pack] Add option to allow setting custom compression level #6393

Closed
1 task done
jankaifer opened this issue Apr 13, 2023 · 1 comment · Fixed by #6406
Closed
1 task done

[pnpm pack] Add option to allow setting custom compression level #6393

jankaifer opened this issue Apr 13, 2023 · 1 comment · Fixed by #6406

Comments

@jankaifer
Copy link
Contributor

jankaifer commented Apr 13, 2023

Describe the user story

vercel/next.js team uses pnpm pack in their tests and our packages contain some rust binaries, which are large and slow to pack. We want to decrease the compression level used in packing to speed this process up. The fastest compression level (1) could pack our packages under .5s, but the default level (6) takes up to 9s.

Some folks may prefer increasing the compression level to achieve a smaller packed size.

Describe the solution you'd like

Anything that could expose this option to the user would work.
For example, tar uses GZIP=-1 environment variable, but we could probably add a command argument or anything else.

It could be quickly done with a single line here:

pack.pipe(createGzip()).pipe(tarball)

Describe the drawbacks of your solution

This is a specific use case that many folks might not need.

Describe alternatives you've considered

None

@zkochan
Copy link
Member

zkochan commented Apr 14, 2023

I don't have objections if the packed tarballs can be installed then without issues.

jankaifer added a commit to jankaifer/pnpm that referenced this issue Apr 16, 2023
This options allows specifying custom compression level.
Underlying node implementation enforces correct number ranges,
but silently ignores `NaN`, so we explicitly check that provided value is valid.

fix pnpm#6393
zkochan added a commit that referenced this issue Apr 16, 2023
This options allows specifying custom compression level.

close #6393

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants