-
-
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
Chunk name #49
Comments
@audiolion Could you provide a small example (code) for that please 😛 |
you can use this package will only add example new CompressionPlugin({
asset: '[path].gz[query]',
algorithm: 'gzip',
test: /\.(js|html)$/,
threshold: 10240,
minRatio: 0.8,
}), |
@audiolion See @sibelius's post |
Given this is a year old perhaps the answer above was the right one and I shouldn't comment on old closed tickets... or put words into anyone elses mouth... but anyway I'm also wondering about this plugin and chunk names. If you are creating a plugin you can listen for events and get a 'compilation' object (as you do yourselves, here: https://github.com/webpack-contrib/compression-webpack-plugin/blob/master/src/index.js#L71). If I run a plugin after the compression plugin this compilation object only contains the 'original' chunk, there is not an additional one created for the compressed output. That is, if I use compilation.getStats().toJSON() I see it can contain ...,
assetsByChunkName:
{ 'my-stuff': 'my-stuff.js' },
assets:
[ { name: 'my-stuff.js',
size: 170482,
etc... },
{ name: 'my-stuff.js.gz',
size: 35944,
etc... } ],
... that is, there is no additional chunk name for the compressed asset. Can/should there be? |
Added more descriptive issue: #185 |
Hello,
Is there a way to attach a chunk name to this output? Other plugins I use work on the chunks that were output and this plugin doesn't attach any chunk name.
This may not be possible (e.g. this plugin is taking the chunks and compressing them and outputting them), but it would be nice if that were the case that it would delete the old files (this function is already there) and the new files would have the same chunk name as the uncompressed version
The text was updated successfully, but these errors were encountered: