javascript - How to target all browsers with Gulp auto-prefixer - Stack Overflow

I am very new to Gulp and have never used any plugins before so I'm a bit lost.I have followed som

I am very new to Gulp and have never used any plugins before so I'm a bit lost.

I have followed some tutorials and just about managed to get Gulp running and the auto-prefixer plugin. I am now just trying to work out if there is a way to get it it prefix for all versions of all browsers?

On this browser list, I can select things like the last 2 versions of all major browsers, or a range of versions, but I would like to select all versions of all browsers (major and other). I am especially trying to add support for the default Samsung browser, as I am having some browser patibility issues with that at the moment and am hoping some prefixes could be the solution.

Here is the code I have so far:

var gulp = require('gulp');
var prefix = require('gulp-autoprefixer');

gulp.task('prefix', function () {
    gulp.src('css/**/*.css')
        .pipe(prefix('last 2 versions'))
        .pipe(gulp.dest('css/'));
});

gulp.task('default', ['prefix']);

Thanks

I am very new to Gulp and have never used any plugins before so I'm a bit lost.

I have followed some tutorials and just about managed to get Gulp running and the auto-prefixer plugin. I am now just trying to work out if there is a way to get it it prefix for all versions of all browsers?

On this browser list, I can select things like the last 2 versions of all major browsers, or a range of versions, but I would like to select all versions of all browsers (major and other). I am especially trying to add support for the default Samsung browser, as I am having some browser patibility issues with that at the moment and am hoping some prefixes could be the solution.

Here is the code I have so far:

var gulp = require('gulp');
var prefix = require('gulp-autoprefixer');

gulp.task('prefix', function () {
    gulp.src('css/**/*.css')
        .pipe(prefix('last 2 versions'))
        .pipe(gulp.dest('css/'));
});

gulp.task('default', ['prefix']);

Thanks

Share Improve this question asked Mar 28, 2017 at 8:52 mrseanbainesmrseanbaines 8332 gold badges15 silver badges26 bronze badges 4
  • Is the Samsung browser just android mobile? – Duderino9000 Commented Mar 28, 2017 at 17:34
  • @Barryman9000 Nope. It's a tablet - Samsung Galaxy 8.0, Android version 4.4.2, browser version 4.4.2 – mrseanbaines Commented Mar 28, 2017 at 18:25
  • It seems strange that a newer Samsung browser wouldn't fall under the "modern browsers" level of support. You can try visiting html5test. to see what's lacking – Duderino9000 Commented Mar 28, 2017 at 22:29
  • Oh... I guess android 4.4 is older. My bad – Duderino9000 Commented Mar 28, 2017 at 22:31
Add a ment  | 

1 Answer 1

Reset to default 5

You can find a list of all the prefix options here. I'm not sure there's anything to target a Samsung browser specifically

https://github./ai/browserslist#queries

So an example autoprefixer task might look like this

let autoprefixBrowsers = ['> 1%', 'last 2 versions', 'firefox >= 4', 'safari 7', 'safari 8', 'IE 8', 'IE 9', 'IE 10', 'IE 11'];

gulp.task('prefix', function () {
    gulp.src('css/**/*.css')
    .pipe(prefix({ browsers: autoprefixBrowsers }))
    .pipe(gulp.dest('css/'));
});

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745419630a4626907.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信