-
Notifications
You must be signed in to change notification settings - Fork 241
/
gulpfile.js
42 lines (38 loc) · 1.02 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
37
38
39
40
41
42
var gulp = require('gulp');
var sass = require('gulp-sass');
var cleancss = require('gulp-clean-css');
var csscomb = require('gulp-csscomb');
var rename = require('gulp-rename');
var autoprefixer = require('gulp-autoprefixer');
gulp.task('watch', function() {
gulp.watch('./**/*.scss', ['build', 'demo']);
});
gulp.task('build', function() {
gulp.src('./src/*.scss')
.pipe(sass({outputStyle: 'compact', precision: 10})
.on('error', sass.logError)
)
.pipe(autoprefixer())
.pipe(csscomb())
.pipe(gulp.dest('./dist'))
.pipe(cleancss())
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('./dist'));
});
gulp.task('demo', function() {
gulp.src('./assets/src/*.scss')
.pipe(sass({outputStyle: 'compact', precision: 10})
.on('error', sass.logError)
)
.pipe(autoprefixer())
.pipe(csscomb())
.pipe(gulp.dest('./assets/css'))
.pipe(cleancss())
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('./assets/css'));
});
gulp.task('default', ['build']);