New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression from 6.x -> 7.x: info() not picking up browserlist configuration #838
Comments
Ouh. This is because Do you want to send PR with |
I'd like to work on this :D |
@riophae great! Wait for PR. Ask any question if you will have them. |
Good to hear riophae is interested in fixing this, was about to mention that I won't likely to have time to look into this properly right now. What comes to the fix, @ai, I was wondering why browserslist is not using the default '.' for But if forgetting changing browserslist, I guess the options for the fix here would be defaulting to '.' in autoprefixer (ie. always sending a filename) or cleaning up the |
Hi @harriha , I was wondering the same as you. The reason why the default value is not applied when |
I don't know if there is any better approach to have those cases well handled though. |
@harriha So, I agree, that in this case |
I will look tomorrow of @riophae fix (thanks for quick PR, I was really want to release it today, but I am drunk) |
Hm. I understood that We can add |
I removed |
Released in 7.1 |
Recently upgraded to
|
Hi @zslabs, |
Hi, |
@zslabs I think it is because 'last 2 versions' is very broad rule. For instance box-shadow in "Blackberry Browser 7" requires -webkit prefix and it is one of the last two. |
To clarify - these were the same settings used in |
@zslabs yep, you are right. It was changed in Browserslist 2.0 (part of Autoprefixer 7.x release). Before that 'last n browsers' was actually 'last n popular' but now it adds prefixes for all browsers including uncommon ones like Blackberry. |
Hi,
At first this looked like a more serious issue than it turned out to be after investigation, but thought to report this anyway. Makes debugging difficult at least, spent a good while thinking my browserslist config isn't being picked up at all.
To clarify: the actual functionality seems to work fine when used as per design via postcss.
Short version: In 7.x,
autoprefixer().info()
with no arguments uses the default browserslist configuration instead of picking up the config from package.json or from the configuration file.To reproduce:
In package.json (or in a separate configuration file), have something custom defined:
Then, run the following code and compare the output between latest 6.x and 7.x versions.
On the last 6.x release (6.7.7), the output is as predicted:
On 7.0.1 the output shows that browserslist defaults are being used:
If calling the
.info()
with explicitfrom
option (autoprefixer().info({ from: '.' })
), things work in 7.x as well.As far as I figured out, the issue seems to come from the fact that
path
option given to browserslist isundefined
, but browserslist falls back to the default path (.
) only if thepath
prop is missing completely.Another thing I noticed with
.info()
is that, even if called for an autoprefixer plugin instance, it doesn't use theoptions
of that instance, but rather always the givenopts
(ref). I feel this is a bit unintuitive as the function is meant for debugging purposes - I'd assume it to show me the exact same configuration as used by the created instance.The text was updated successfully, but these errors were encountered: