Empty output when using with cssnano
alexa-infra opened this issue · 1 comments
alexa-infra commented
Something goes wrong when using postcss-nested with cssnano in the postcss pipeline.
> cat no-bug.css
#hello {
&.world {
background-color: red;
}
}
> cat no-bug.css | npx postcss -u postcss-nested --no-map | npx postcss -u cssnano --no-map && echo
#hello.world{background-color:red}
> cat no-bug.css | npx postcss -u postcss-nested -u cssnano --no-map && echo
#hello.world{background-color:red}
> cat bug.css
#hello {
&.world {
background-color: red;
.bug {
background-color: red;
}
}
}
> cat bug.css | npx postcss -u postcss-nested --no-map | npx postcss -u cssnano --no-map && echo
#hello.world,#hello.world .bug{background-color:red}
> cat bug.css | npx postcss -u postcss-nested -u cssnano --no-map && echo
Note the last command produces no output, but the previous command works as expected.
To summarize, if I use raw output from postcss-nested and pass it to cssnano, then it works as expected; if I use both postcss-nested with cssnano in the postcss pipeline, then it produces no output from that buggy file.
"cssnano": "^4.1.10",
"postcss": "^8.2.2",
"postcss-nested": "^5.0.3",
Not sure if it's a bug in postcss-nested, but it has appeared after upgrading from postcss-nested 4.1.2 and postcss 7.0.0 (cssnano version hasn't changed)
ai commented
Sorry. I will not have time in a few next weeks. PR is welcome.