Created by: ai
Hi. I moved browsers from Autoprefixer’s inner option to browserslist in package.json.
Reason
- Autoprefixer team recommends only
package.browserslistas a way to set target browsers. -
package.browserslistis 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-env7.0. - It is used by
autoprefixer-infoCLI tool. This CLI tool is part ofautoprefixerpackage, 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.jsonforbrowserslistkey.