Closed agarzola closed 5 years ago
hey @agarzola! I haven't worked on this for a while. But you're right. Something seems off.
Don't bother with the debug logs. I used these back in the days when I had serious trouble debugging complex constructs for testing and validation. These could very well show you some incorrect numbers. I'm not sure about the terminology and what constitutes a rule either. But if I remember correctly, it refers to pretty much 'any line that is not a closing tag or a whiteline'.
But yea, checking out your sample, I'm a bit shocked that this simple example would fail. My first suspicion would be user error but looking through your code, I'd assume it's correct (at least I'd do the same if you'd ask me to do it :D )
I'll try to find some time to verify why this isn't working as expected.
Since it's been a while since I used it myself and I barely remember the options and the defaults: Did you try setting the separators etc using the config? Did that not yield better results?
Thanks for the prompt reply, @mrnocreativity! I was about to update this with the following comment: After writing this, it occurred to me that I should check against the latest version of gulp-postcss
(v7.0.1
, as of this comment). This appears to have fixed the issue.
The debug logs are still confusing, but I’ll follow your advice and pay no attention to them. 😄 Thanks again for the blazingly fast response and for putting this tool out there!
Glad you were able to solve this! Have fun and good luck with your project :)
Hi! 👋 I noticed some rules missing from my critical CSS files, so I reproduced the issue with a contrived example. Given the following CSS:
And the following gulp tasks:
I’m getting the following in my
test-noncritical.css
file:and an empty
test-critical.css
.The debug info for the
output: 'critical'
config:The debug info for the
output: 'rest'
config:I’m not sure what constitutes a
rule
in the context of these debug logs, but I find8
to be far more than I expect.criticalPercentage
seems low, considering what’s inside thecritical:start
/critical:end
comment tags.I’m using
gulp-postcss
v6.4, if that means anything. Also, in case it’s useful, the CSS I’m feeding throughpostcss-critical-split
is generated viagulp-sass
in a separate task.Please let me know if I’m doing something wrong here, or if there is any other information I can provide that would be useful to you. Thanks!