autoprefixer: `browserslist` not working with gulp-postcss

I need to help with this, it seems autoprefixer is not taking the browserslist options.

…root/package.json

  "browserslist": [
    "last 4 versions",
     "Safari 7",
    "ie 10"
  ],

…root/dist/gulp.js

.pipe(postcss([autoprefixer()]))

thanks!

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 31 (16 by maintainers)

Most upvoted comments

You can also hack around it by importing the package.json into your gulp file:

import pkg from './package.json';

...

.pipe(postcss([autoprefixer({
   overideBrowserslist: pkg.browserslist,
})]))

Or with older versions of Autoprefixer:

import pkg from './package.json';

...

.pipe(postcss([autoprefixer({
   browserslist: pkg.browserslist,
})]))