-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
47 lines (37 loc) · 997 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
44
45
46
47
var gulp = require('gulp');
var postcss = require('gulp-postcss');
var sass = require('gulp-sass');
var cssmin = require('gulp-cssmin');
var rename = require('gulp-rename');
var autoprefixer = require('autoprefixer');
var cssnano = require('cssnano');
/**
*
*/
gulp.task('start', function () {
gulp.watch('src/flex-grid.scss', [ 'process_scss' ]);
});
gulp.task('process_scss', function () {
var plugins = [
autoprefixer({browsers: ['last 5 version']}),
cssnano()
];
return gulp.src([
'./src/flex-grid.scss'
])
.on('error', onError)
.pipe(sass())
.on('error', onError)
.pipe(postcss(plugins))
.on('error', onError)
.pipe(cssmin())
.on('error', onError)
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('./dist'));
});
function onError(err) {
console.log(err);
this.emit('end');
}