Skip to content

Instantly share code, notes, and snippets.

@helloncanella
Last active June 2, 2017 22:36
Show Gist options
  • Select an option

  • Save helloncanella/098110505c55f401ecd312df929b5b39 to your computer and use it in GitHub Desktop.

Select an option

Save helloncanella/098110505c55f401ecd312df929b5b39 to your computer and use it in GitHub Desktop.
Auto prefix - gulp
/*
Before run this script do:
$ npm install gulp-cli -g
$ npm install gulp-autoprefixer gulp -D
Once done, in the folder you have put it, just run:
$ gulp prefixes
*/
const gulp = require('gulp');
const autoprefixer = require('gulp-autoprefixer');
const AUTOPREFIXER_BROWSERS = [
'Android 2.3',
'Android >= 4',
'Chrome >= 35',
'Firefox >= 31',
'Explorer >= 9',
'iOS >= 7',
'Opera >= 12',
'Safari >= 7.1',
];
gulp.task('prefixes', () =>
gulp.src(['src/**/*.{scss, css}'])
.pipe(autoprefixer({
browsers: AUTOPREFIXER_BROWSERS,
cascade: false
}))
.pipe(gulp.dest('src'))
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment