forked from csstools/sanitize.css
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
36 lines (33 loc) · 1.08 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
var gulp = require('gulp');
var autoprefixer = require('autoprefixer');
var minifyCSS = require('gulp-minify-css');
var postcss = require('gulp-postcss');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var processors = [
autoprefixer({browsers: ["Android >= 4.3", "Chrome >= 39", "Edge >= 12", "Firefox >= 34", "Explorer >= 9", "iOS >= 7", "Safari >= 7", "ExplorerMobile >= 10"]})
];
var rename = require('gulp-rename');
gulp.task('development', function() {
return gulp.src('sanitize.scss')
.pipe(sourcemaps.init())
.pipe(sass({
outputStyle: 'expanded'
}))
.pipe(postcss(processors))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('./dist'));
});
gulp.task('minified', function() {
return gulp.src('sanitize.scss')
.pipe(sourcemaps.init())
.pipe(sass({
outputStyle: 'expanded'
}))
.pipe(minifyCSS())
.pipe(postcss(processors))
.pipe(rename({suffix: '.min'}))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('./dist'));
});
gulp.task('default', ['minified', 'development']);