Skip to content

Latest commit

 

History

History
43 lines (34 loc) · 1.51 KB

autoprefixer.md

File metadata and controls

43 lines (34 loc) · 1.51 KB

Change target browsers for Autoprefixer

Currently, the CLI uses Autoprefixer to ensure compatibility with different browser and browser versions. You may find it necessary to target specific browsers or exclude certain browser versions from your build.

Internally, Autoprefixer relies on a library called Browserslist to figure out which browsers to support with prefixing.

There are a few ways to tell Autoprefixer what browsers to target:

Add a browserslist property to the package.json file

"browserslist": [
  "> 1%",
  "last 2 versions"
]

Add a new file to the project directory called .browserslistrc

### Supported Browsers

> 1%
last 2 versions

Autoprefixer will look for the configuration file/property to use when it prefixes your css. Check out the browserslist repo for more examples of how to target specific browsers and versions.

Side note: Those who are seeking to produce a progressive web app and are using Lighthouse to grade the project will need to add the following browserslist config to their package.json file to eliminate the old flexbox prefixes:

package.json config:

"browserslist": [
  "last 2 versions",
  "not ie <= 10",
  "not ie_mob <= 10"
]