-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
31 lines (25 loc) · 779 Bytes
/
gulpfile.js
File metadata and controls
31 lines (25 loc) · 779 Bytes
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
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var minifyCSS = require('gulp-minify-css');
var rename = require('gulp-rename');
gulp.task('sass', function () {
return gulp.src('./styles/src/main.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('./styles/dist'));
});
gulp.task('sass:watch', function () {
gulp.watch('./styles/src/main.scss', ['sass']);
});
gulp.task('minify-css', function() {
return gulp.src('./styles/dist/main.css')
.pipe(minifyCSS({keepBreaks:true}))
.pipe(rename({
suffix: ".min",
}))
.pipe(gulp.dest('./styles/dist/'))
});
gulp.task('min-css', function () {
gulp.watch(['./styles/dist/main.css'], ['minify-css']);
});
gulp.task('default', ['sass', 'sass:watch']);