-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
43 lines (37 loc) · 1012 Bytes
/
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
37
38
39
40
41
42
43
'use strict';
const gulp = require('gulp');
const plumber = require('gulp-plumber');
const cached = require('gulp-cached');
const progeny = require('gulp-progeny');
const sass = require('gulp-sass');
const csscomb = require('gulp-csscomb');
const cssnano = require('gulp-cssnano');
const replace = require('gulp-replace');
const dir = {
styles : {
src : 'source/scss/*.scss',
dst : 'source/css'
}
}
const AUTOPREFIXER_BROWSERS = [
'>0.25%',
'not ie 11',
'not op_mini all'
]
// Compile SASS to CSS
function styles() {
return gulp.src(dir.styles.src)
.pipe(plumber())
.pipe(cached('styles'))
.pipe(progeny())
.pipe(sass())
.pipe(csscomb())
.pipe(cssnano({autoprefixer: {browsers: AUTOPREFIXER_BROWSERS}}))
.pipe(replace(/@charset 'UTF-8';/g, ''))
.pipe(gulp.dest(dir.styles.dst))
}
function watch() {
gulp.watch(dir.styles.src, styles);
}
gulp.task('watch', watch);
gulp.task('default', watch);