Closed patric-eberle closed 5 years ago
Example for output:
shop.app.2a79319698422fa1b963.css
shop.app.2a79319698422fa1b963.print.css
shop.module.cart.d03322c1b9a00b22bd72.css
shop.module.cart.d03322c1b9a00b22bd72.print.css
where the module.cart.x.print.css
has no content.
To my mind that is expected behavior: the postcss plugin will always return a result (even if that result is 'no css at all'). I think you should check for the output before creating the files (or delete empty files later on).
I'm not sure how the pipeline plugin works so I can't speak for them. Perhaps, they could provide an option that disallows creation of empty files?
@patric-eberle, what do you think?
@mrnocreativity thank you for your answer. If it was a configurable option (drop output if no content is available) I would have seen it more on this side, since the pipline only executes mutiple postCSS scripts and most likely won‘t care what they are doing. I guess we will just have to deal with this behaviour then.
It seems to me like
postcss-critical-split
also creates files without content. We have a setup with print styles. While the/* print */
blocks are extracted correctly, when working with webpack chunks, some of the chunks don't contain this blocks, but I get still ax.print.css
file without content. Is there a way to prevent "empty file output" or is this probably even a bug?My postcss-critical-split setup in combination with
post-css-pipeline-webpack-plugin