-
-
Notifications
You must be signed in to change notification settings - Fork 188
Compress option not working in CLI - possible conflict with other options #195
Comments
Might be related to this: #194 |
Not sure how it's related since nobody raised this issue until now. |
Thanks for the quick responses! Yes I get the same issue, even without the charset rule. I.e. Even basic input isn't compressed. If you can't reproduce then perhaps there's something wrong at my end? Are you able to produce the expected output in the example above?
|
I tested historical versions in clean environments and discovered that the unexpected behaviour only started in This coincides with the upgrade to cssnano
|
I confirm that starting from v1.8.0, compression does not work. I use cssnext as a PostCSS plugin. |
@ben-eb seems correct to me based on my testing. When I changed postcssPlugin names to be unique, everything started working again. |
Tests were passing when 1.8.3 were released, and now the same tests are broken with a fresh install. |
You can work around this by passing this config to cssnext (since cssnano 2.5.0): {
compress: {filterPlugins: false}
} |
Fix released as 1.8.4 |
Using the
-c
flag within the CLI does not actually compress a given input file underv1.8.3
.E.g. let's consider the compression example on the cssnano homepage:
input.css
We'd expect
cssnext -c input.css
to give us this:However we just get back the original
input.css
(non-compressed).After some digging I found that adding the following flags in addition to
-c
seems to help, so I imagine there's a conflict with how cssnano is being called:Hacky workaround - disable everything but compression:
> cssnext -c input.css --no-custom-properties --no-calc --no-custom-media --no-media-queries-range --no-custom-selectors --no-color-rebeccapurple --no-color-hwb --no-color-gray --no-color-hex-alpha --no-color-function --no-font-variant --no-filter --no-rem --no-pseudo-elements --no-pseudo-class-matches --no-pseudo-class-not --no-pseudo-class-any-link --no-color-rgba --no-autoprefixer
The above delivers compressed output, but it obviously isn't ideal given we're effectively disabling all the other features within cssnext.
Has anyone run into the same issue?
The text was updated successfully, but these errors were encountered: