-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
35 lines (29 loc) · 918 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
var gulp = require('gulp');
var sass = require('gulp-ruby-sass');
var autoprefixer = require('gulp-autoprefixer');
var minifycss = require('gulp-minify-css');
var rename = require('gulp-rename');
// var uncss = require('gulp-uncss');
var concatcss = require('gulp-concat-css');
var es = require('event-stream');
gulp.task('style', function () {
var app_files = gulp.src('styles/main.scss')
.pipe(sass({style: 'expanded'}));
var reset = gulp.src('styles/reset.css')
es.concat(app_files, reset)
.pipe(concatcss('build.css'))
// .pipe(uncss({
// html: ['index.html']
// }))
.pipe(autoprefixer('last 2 version'))
.pipe(gulp.dest('build/'))
.pipe(rename({suffix: '.min'}))
.pipe(minifycss())
.pipe(gulp.dest('build/'));
});
gulp.task('watch', function () {
gulp.watch('styles/*.scss', function () {
gulp.start('style');
});
});
gulp.task('default', ['style']);