-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
47 lines (30 loc) · 897 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
var gulp = require('gulp');
var sass = require('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var sourcemaps = require('gulp-sourcemaps');
var minify = require('gulp-clean-css');
var rename = require('gulp-rename');
gulp.task('styles', function() {
return gulp.src('scss/**/*.scss')
.pipe(sourcemaps.init())
.pipe(sass({
outputStyle: 'expanded'
}).on('error', sass.logError))
.pipe(autoprefixer({
browsers: ['last 2 versions']
}))
.pipe(sourcemaps.write())
.pipe(gulp.dest('css'));
});
gulp.task('watch', ['styles'], function () {
gulp.watch('scss/**/*.scss', ['styles']);
});
gulp.task('postcss', function() {
return gulp.src('css/*.css')
.pipe(minify())
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('css'))
});
gulp.task('default', ['watch']);