Created by: ai
Hi. I moved browsers from Autoprefixer’s inner option to browserslist
in package.json
.
Reason
- Autoprefixer team recommends only
package.browserslist
as a way to set target browsers. -
package.browserslist
is used in many different tools. It is used byautoprefixer
,stylelint-no-unsupported-browser-features
,eslint-plugin-compat
,postcss-cssnext
,postcss-preset-env
,postcss-normalize
. The most important, this config will be used in nextbabel-preset-env
7.0. - It is used by
autoprefixer-info
CLI tool. This CLI tool is part ofautoprefixer
package, but didn’t work correctly without Browserslist config. - This config is useful not only for tools. The new developer will have the single place to check target browsers in a new project.
- CSS-Tricks agree that Browserslist config is really good idea.
Test
- Create a new project.
- Check project’s
package.json
forbrowserslist
key.