-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathgulpfile.js
34 lines (31 loc) · 1.01 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
/* global require */
var gulp = require('gulp'),
sass = require('gulp-sass'),
notify = require('gulp-notify'),
plumber = require('gulp-plumber'),
autoprefixer = require('gulp-autoprefixer'),
lec = require('gulp-line-ending-corrector');
gulp.task('serve', ['scss'], function () {
/**
* watch for changes in scss files
*/
gulp.watch("./scss/**/*.scss", ['scss']);
});
/**
* scss task, will compile the .scss files,
* and handle the error through plumber and notify through system message.
*/
gulp.task('scss', function () {
return gulp.src('./scss/**/*.scss')
.pipe(plumber({
errorHandler: notify.onError("Error: <%= error.messageOriginal %>")
}))
.pipe(sass({outputStyle: 'expanded'})) // compressed
.pipe(autoprefixer({
browsers: ['last 6 versions'],
cascade: false
}))
.pipe(lec({verbose: true, eolc: 'CRLF', encoding: 'utf8'}))
.pipe(gulp.dest('./css/'))
});
gulp.task('default', ['serve']);