info() not seeing browserlist configuration
See original GitHub issueThis is similar to #838.
When using 7.1.6, the info()
method on the plugin returns the default list of browsers no matter what your configuration is.
Example usage:
.browserslistrc (or browserslist
, or package.json
)
safari >= 6
gulpfile.js
var autoprefixer = require('autoprefixer');
var ap = autoprefixer({
cascade: false,
add: true,
remove: false,
supports: true,
flexbox: true,
grid: false
});
console.log(ap.info());
Results in this output:
Browsers:
Chrome for Android: 61
Firefox for Android: 56
And_qq: 1.2
UC for Android: 11.4
Android: 56, 4.4.3-4.4.4
Baidu: 7.12
Bb: 10, 7
Chrome: 62, 61, 60, 49
Edge: 16, 15
Firefox: 56, 55, 52
IE: 11, 10
IE Mobile: 11, 10
iOS: 11, 10.3, 10.0-10.2
Opera Mini: all
Opera Mobile: 37, 12.1
Opera: 48, 47
Safari: 11, 10.1
Samsung: 5, 4
Where the correct output would look like:
Browsers:
Safari: 11, 10.1, 10, 9.1, 9, 8, 7.1, 7, 6.1, 6
Looking into the code, I believe the issue is that the plugin.info
method’s opts
var is undefined
since nothing is passed in (as per the docs).
I believe the fix is to change line 96 to be:
return require('./info')(loadPrefixes({ from: path.resolve('.') }));
I’d be happy to make a PR to this effect, but I wanted to open a discussion first!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:6 (6 by maintainers)
Top Results From Across the Web
caching - Angular 12 ignoring configuration files or reading ...
The following answer assumes you are using npm as package manager · Ensure that you dont have browserlist in your package.json "browserslist": [ ......
Read more >browserslist - npm
The config to share target browsers and Node.js versions between different front-end tools. It is used in: Autoprefixer · Babel · postcss-preset ...
Read more >Browserslist on Twitter: "Browserslist 4.21 was released. — IE ...
Browserslist 4.21 now have browserslist.parse() method. It will find Browserslist config and return AST of this config.
Read more >Supported Browsers and Features | Create React App
The browserslist configuration controls the outputted JavaScript so ... This is due to an issue in babel-loader not detecting the change in ...
Read more >Pierre GAMBAROTTO / Maquette_fork · GitLab - PLMlab - CNRS
Browsers that we support defaults not IE 11 not IE_Mob 11 maintained node versions ... Browserslist will take queries from tool option, browserslist...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You must provide
from
optionBut I understand that it is not clear. There are 2 options:
process.cwd
) tofrom
. But if users will have different configs (likesrc/legacy/.browserslistrc
), they will not know how to load it properly.from
option.What do you think?
Sorry. Grid fix was delayed. Hope to release it on next week.