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

Brotli support #92

Closed
gauravdewan007 opened this issue Dec 25, 2017 · 9 comments
Closed

Brotli support #92

gauravdewan007 opened this issue Dec 25, 2017 · 9 comments

Comments

@gauravdewan007
Copy link

Goal of this plugin is to Prepare compressed versions of assets to serve them with Content-Encoding. Currently it supports gzip but it can be expanded to support brotli compression (and maybe combine zopfli - which is there elsewhere in this git org).
Brotli is supported by all modern browsers now. This plugin could provide defaul option to use brotli with fallback to gzip.

@alexander-akait
Copy link
Member

@gauravdewan007 PR welcome 👍

@robcresswell
Copy link

There is already a brotli plugin - perhaps we could use the code from there?

In terms of format I'd suggest defaulting to gzip and adding a config flag to upgrade to brotli, for compatibility reasons. Otherwise people using the compression plugin with older browsers would see their current workflow break.

@robcresswell
Copy link

robcresswell commented Jan 19, 2018

This PR from 2016 is also relevant: #31

As you can see in the reference above, I've contacted the brotli plugin author to see if they'd have time; if not, I can adopt it, although there's going to be big delay time (I'm going on holiday for the next week or so, and have no idea how webpack plugins work, but happy to learn).

@alexander-akait
Copy link
Member

alexander-akait commented Jan 19, 2018

@robcresswell i think it is out of scope this plugin, better create other plugin for this purpose.
@michael-ciniawsky what do you think?

@robcresswell
Copy link

It sounds a lot like the other repo is basically a clone of this one with a different compression lib, judging from the config and README.

@alexander-akait
Copy link
Member

@robcresswell we can add option package (need better name) and use here https://github.com/webpack-contrib/compression-webpack-plugin/blob/master/src/index.js#L44 to load from need package, let's wait what says @michael-ciniawsky

@mynameiswhm
Copy link

i think it is out of scope this plugin, better create other plugin for this purpose.

@evilebottnawi oh whait, there is another plugin for this purpose already which is being discussed in this thread :)

@robcresswell the reason for not stuffing every single compression algorithm into one plugin is to not download/compile a lot of unnecessary compression dependencies if you only need gzip.
The only real problem that plugin for gzip compression is historically called compression-webpack-plugin, not gzip-webpack-plugin, which may be misleading for newcomers.

@robcresswell
Copy link

Yeah, that makes sense I suppose. Just seems a shame to maintain two very similar plugins separately.

@michael-ciniawsky
Copy link
Member

Since most alternative compression algorithms require a native addon, compression-webpack-plugin will only support what is being provided by node (GZIP) itself to avoid possible cross platform issues. Therefore support for alternative algorithms in compression-webpack-plugin is not planned atm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants