forked from miradozk/yonta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
executable file
·54 lines (45 loc) · 1.54 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
43
44
45
46
47
48
49
50
51
52
53
54
// Require all those npm-modules
var gulp = require('gulp'),
sass = require('gulp-sass'),
autoprefixer = require('gulp-autoprefixer'),
cssmin = require('gulp-cssmin'),
rename = require('gulp-rename'),
del = require('del'),
concat = require('gulp-concat'),
notify = require('gulp-notify'),
cache = require('gulp-cache'),
plumber = require('gulp-plumber');
// render scss
gulp.task('styles', function() {var onError = function(err) {
notify.onError({
title: "Gulp",
subtitle: "Failure!",
message: "Error: <%= error.message %>",
sound: "Submarine"
})(err);
this.emit('end');
};
gulp.src('./src/main.scss')
.pipe(plumber({errorHandler: onError}))
.pipe(sass({ style: 'expanded' }))
.pipe(autoprefixer('last 2 version', 'IE 11', 'safari 9', 'Firefox ESR', 'ios 10', 'android 5'))
.pipe(rename('app.not-minified.css'))
.pipe(gulp.dest('./css'))
.pipe(cssmin())
.pipe(rename('app.css'))
.pipe(gulp.dest('./css'))
});
// watch it while working
gulp.task('watch', function() {
// Watch .scss files
gulp.watch('src/*.scss', ['styles']);
});
// clean the folders
gulp.task('cleanup', function(cb) {
del(['./css/*'], cb)
});
// default: all of them! \o/
gulp.task('default', function() {
gulp.start('cleanup');
gulp.start('styles');
});