last-call-webpack-plugin icon indicating copy to clipboard operation
last-call-webpack-plugin copied to clipboard

Add webpack 5 support

Open bebraw opened this issue 4 years ago • 6 comments

As webpack 5 has multiple deprecations, it seems this plugin is facing some of them as well. It seems the plugin still works but the APIs it depends on will be gone in the future.

I'm using the plugin through optimize-css-assets-webpack-plugin and when you use last-call-webpack-plugin, it emits the following deprecation warning:

DeprecationWarning: optimizeChunkAssets is deprecated (use Compilation.hook.processAssets instead and use one of Compilation.PROCESS_ASSETS_STAGE_* as stage option)

I believe you may need to add a check against webpack 4/5 (see https://github.com/webpack-contrib/mini-css-extract-plugin/blob/master/src/index.js for reference) and then adapt to the new API.

bebraw avatar Sep 28 '20 12:09 bebraw

Tried to fix this issue: https://github.com/NMFR/last-call-webpack-plugin/pull/9

@NMFR

severin-d avatar Oct 14 '20 09:10 severin-d

@bebraw There is nothing holding you back using optimize-css-assets-webpack-plugin, but you could swap it for css-minimizer-webpack-plugin.

The description says

Just like optimize-css-assets-webpack-plugin but more accurate with source maps and assets using query string, allows to cache and works in parallel mode.

And it doesn't use the deprecated hook call.

jarroput avatar Mar 16 '21 09:03 jarroput

@jarroput Yup, that plugin is my official recommendation.

I would say fixing this issue is worth it given this particular plugin is getting five million downloads per week at the moment while the other one is hovering around 230k.

The fix in #9 looks adequate.

bebraw avatar Mar 16 '21 09:03 bebraw

I second this. #9 looks mergable to me as well.

arjansingh avatar Aug 24 '21 19:08 arjansingh

there is

(node:35546) [DEP_WEBPACK_COMPILATION_OPTIMIZE_CHUNK_ASSETS] DeprecationWarning: optimizeChunkAssets is deprecated (use Compilation.hooks.processAssets instead and use one of Compilation.PROCESS_ASSETS_STAGE_* as stage option)

because of last-call-webpack-plugin https://github.com/NMFR/last-call-webpack-plugin/blob/master/src/index.js#L176

any updates?

nikbelikov avatar Feb 09 '22 18:02 nikbelikov

@nikbelikov It's probably better to migrate to https://www.npmjs.com/package/css-minimizer-webpack-plugin or fork this one with the webpack 5 fix as the author seems busy.

bebraw avatar Feb 09 '22 19:02 bebraw