-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
Compression Level option (or hardcode to 9) #12
Comments
Was looking to do the same thing. While I agree it'd be a useful option, @sokra has a lot on his plate. This is my workaround: First, define your algorithm... var zlib = require('zlib');
function gzipMaxCompression(buffer, callback) {
return zlib['gzip'](buffer, {level: 9}, callback)
} ...then pass to new CompressionPlugin({
algorithm: gzipMaxCompression
}) |
@bfin thanks very much, this workaround is exactly what I needed. I completely missed that you could pass in a function as the algorithm. |
I've put in a pull request to add level as an option and set it by default to 9. Hopefully this can get merged in: #13 |
Please note that the function gzipMaxCompression(buffer, options, callback) {
return zlib['gzip'](buffer, {level: 9}, callback);
} |
Since ideally this should be part of a build chain that compresses once and then delivers many times (as opposed to live compression) it makes sense to use the highest possible compression level.
Can you please either add an option to specify, or else change the default to use level 9 instead of the zlib default of 6.
The text was updated successfully, but these errors were encountered: