M
M
MyQuestion2020-03-09 19:22:25
Automation
MyQuestion, 2020-03-09 19:22:25

How to configure gulp-autoprefixer, where did the browsers configuration setting go?

I'm just getting started with gulp. I'm looking at usage examples, I got to the autoprefixer and the browsers[' '] parameter is used everywhere. Now on github in the use case only the parameter "cascade: false". In the code browsers['> 0.2% '] or for example "last 7 versions" will not work either.
The documentation is still hard for me to read. For example, I found the browserslist [] parameter, but I don’t quite understand where and how to use it, the description says that this is a parameter for package.json.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Just Me, 2020-03-09
@MyQuestion

gulpfile.js

const autoprefixer = require('gulp-autoprefixer');

function scssTask(){    					
  return src(files.scssPath)					
    .pipe(sourcemaps.init()) 					
    .pipe(sass()) 					
    .pipe(autoprefixer())		
    .pipe(sourcemaps.write('.')) 					
    .pipe(dest('public/css')					
  ); 					
}

package.json
"main": "gulpfile.js",
  "browserslist": [
    "last 2 version",
    "> 1%",
    "maintained node versions",
    "not dead"
  ],
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },

details

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question