-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
62 lines (54 loc) · 1.57 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
55
56
57
58
59
60
61
var gulp = require('gulp');
var sass = require('gulp-sass');
var slim = require('gulp-slim');
var minifyCSS = require('gulp-minify-css');
var uglify = require('gulp-uglify');
var plumber = require('gulp-plumber');
var notify = require('gulp-notify');
gulp.task('sass', function() {
return gulp.src('./src/style/**/*.sass')
.pipe(plumber( { errorHandler: function(error) {
notify.onError({
title: "Gulp error in "+ error.plugin,
message: error.toString()
})(error);
}}))
.pipe(sass( {
includePaths: ['./src/style'],
outputStyle: 'expanded'
}))
.pipe(gulp.dest('./style'))
});
gulp.task('sass-minified', function() {
return gulp.src('./src/style/**/*.sass')
.pipe(plumber( { errorHandler: function(error) {
notify.onError({
title: "Gulp error in "+ error.plugin,
message: error.toString()
})(error);
}}))
.pipe(sass( {
includePaths: ['./src/style'],
outputStyle: 'expanded'
}))
.pipe(minifyCSS())
.pipe(gulp.dest('./style'))
});
gulp.task('slim', function() {
return gulp.src('./src/view/*.slim')
.pipe(plumber())
.pipe(slim({ pretty: true}))
.pipe(gulp.dest('./'))
});
gulp.task('uglify', function() {
return gulp.src('./src/js/*.js')
.pipe(plumber())
.pipe(uglify())
.pipe(gulp.dest('./js'))
});
gulp.task('watch', function() {
gulp.watch('./src/style/**/*.sass', ['sass']);
gulp.watch('./src/view/**/*.slim', ['slim']);
});
gulp.task('default', ['sass', 'slim', 'watch'] )
gulp.task('release', ['sass-minified', 'uglify', 'slim', 'watch'] )