webpack-contrib/compression-webpack-plugin

Doesn't compress output of PrerenderSPA Plugin

Tofandel opened this issue · 3 comments

Hello, there is an issue when using the prerender spa plugin because this plugin runs on emit and the prerender plugin runs after emit, the files generated by the plugin will not be compressed and the original index.html will also be the one compressed instead of the one prerendered

Is there any workaround for this issue?

Maybe related to #218

No, you need to open an issue in https://github.com/chrisvfritz/prerender-spa-plugin, it is not compatibility with webpack v5, plugins should use compilation.hooks.processAssets for working with assets (https://github.com/webpack-contrib/compression-webpack-plugin/blob/master/src/index.js#L307), it is breaking change for webpack v5, so we can't fix it, sorry

Changing something in emit hooks is unsafe and even break cache

I see, so this plugin works correctly on webpack 5 correct? The other plugin needs to catch up to v5 and it should work?

Sadly right now the vue ecosystem is lagging on webpack 5 and 40% of the plugins still don't work on it

I see, so this plugin works correctly on webpack 5 correct? The other plugin needs to catch up to v5 and it should work?

Yes and yes

Sadly right now the vue ecosystem is lagging on webpack 5 and 40% of the plugins still don't work on it

Yep, migration is not easy, that is why we are moving more and more things to the core, so that the next migrations will be easier