bennypowers/lit-css

Replacing uglifycss

muratcorlu opened this issue · 3 comments

UglifyCSS replacing 0pxs to 0 without any configuration options. And that causes issues with using 0px in CSS variables, like defined here: https://www.oddbird.net/2022/08/04/zero-units/

When I check UglifyCSS repository I see that it's not maintained for a long time. Can we consider replacing it with a more modern and configurable option like clean-css?

Fascinating! thanks for the issue. Yes, I'm happy to review a PR that replaces uglify css with clean-css.

In the mean time, you can workaround by setting uglify: false and using transform

litCssPlugin({
  uglify: false,
  transform: (data, { filePath }) => new CleanCSS().minify(data),
})

I can try to send a PR for that but it will be a breaking change for the library since config options and outputs will be different starting from that point. Are you ok to publish a major release for that?

we can deprecate uglify and add a minify option, it can be a minor release for now with a planned major release later on, say in 6 mo or 1yr