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

Add webpack 5 support #8

Open
bebraw opened this issue Sep 28, 2020 · 6 comments · May be fixed by #9
Open

Add webpack 5 support #8

bebraw opened this issue Sep 28, 2020 · 6 comments · May be fixed by #9

Comments

@bebraw
Copy link

bebraw commented Sep 28, 2020

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.

@severin-d
Copy link

severin-d commented Oct 14, 2020

Tried to fix this issue:
#9

@NMFR

@jarroput
Copy link

@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.

@bebraw
Copy link
Author

bebraw commented Mar 16, 2021

@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.

@arjansingh
Copy link

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

@nikbelikov
Copy link

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?

@bebraw
Copy link
Author

bebraw commented Feb 9, 2022

@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.

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

Successfully merging a pull request may close this issue.

5 participants