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

Refactor: Replace optimize-css-assets-webpack-plugin #1436

Conversation

rschristian
Copy link
Member

@rschristian rschristian commented Sep 22, 2020

What kind of change does this PR introduce?

Refactor

Did you add tests for your changes?

No new tests, but modified existing ones

Summary

I was talking to the people over at cssnano a while back and they were quite opinionated against optimize-css-assets-webpack-plugin, saying things such as "Anyway optimize-css-assets-webpack-plugin is bad solution with many bugs, also no caches and parallels" and "I will say again that the plugin is not designed correctly and does not support all webpack features". While I don't know enough to support their claims, I did say I'd bring it up here (even if I did forget about it for a bit).

They suggest css-minimizer-webpack-plugin in its place, the documentation for which can be found here. They advertise it as "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." Now, this plugin is relatively new and has roughly ~4.35 million fewer downloads per week than optimize so there's certainly potential downside to moving to a far lesser used plugin.

This PR replaces optimize-css-assets-webpack-plugin with css-minimizer-webpack-plugin as a draft to get opinions. It seems to be pretty much interchangeable with css-minimizer-webpack-plugin, only generating a few more *.css.map files.

Ultimately just a proof of concept of draft I thought I'd float. If it is truly better maybe it's eventually worth looking at.

Does this PR introduce a breaking change?

Yes, this would be a breaking change. Any users who rely on optimize-css-assets-webpack-plugin for some specific functionality would have their configurations broken. Some of the options can be found on css-minimizer though the configuration will be slightly different in addition to the need to target a new plugin.

@changeset-bot
Copy link

changeset-bot bot commented Sep 22, 2020

💥 No Changeset

Latest commit: 29c387a

Merging this PR will not cause any packages to be released. If these changes should not cause updates to packages in this repo, this is fine 🙂

If these changes should be published to npm, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@rschristian rschristian deleted the refactor/cssMinimizerWebpackPlugin branch November 20, 2020 05:45
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 this pull request may close these issues.

None yet

1 participant