-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
36 lines (29 loc) · 892 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
'use strict';
var css = [
'./assets/css/index.css'
];
var gulp = require('gulp');
var sass = require('gulp-sass');
var concat = require("gulp-concat");
var cssmin = require("gulp-cssmin");
var stripCssComments = require('gulp-strip-css-comments');
gulp.task('sass', function () {
return gulp.src('./assets/sass/**/*.scss')
.pipe(sass.sync().on('error', sass.logError))
.pipe(gulp.dest('./assets/css'));
});
gulp.task('minify-css', function(){
gulp.src(css)
.pipe(stripCssComments({all: true}))
.pipe(concat('app.min.css'))
.pipe(cssmin())
.pipe(gulp.dest('./assets/css/'));
});
// gulp.task('sass:watch', function () {
// gulp.watch('./assets/sass/**/*.scss', ['sass']);
// });
gulp.task('default',['sass', 'minify-css']);
gulp.task('watch', function() {
gulp.watch('./assets/sass/**/*.scss', ['sass']);
gulp.watch(css, ['minify-css']);
});