forked from mikeblum/hugo-now
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
60 lines (52 loc) · 1.43 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
var gulp = require('gulp'),
sass = require('gulp-sass'),
concat = require('gulp-concat'),
minify = require('gulp-minify'),
exec = require('gulp-exec'),
rename = require('gulp-rename'),
autoprefixer = require('gulp-autoprefixer'),
del = require('del');
gulp.task('pygments', function() {
var options = {
continueOnError: false,
pipeStdout: false
};
});
gulp.task('clean', function() {
del([
'static/js/dist/**/*.min.js'
]);
});
gulp.task('sass', function() {
gulp.src('sass/style.scss')
.pipe(sass()
.on('error', sass.logError))
.pipe(autoprefixer())
.pipe(gulp.dest('static/css/'));
});
gulp.task('minify-sass', function() {
gulp.src('sass/style.scss')
.pipe(sass({ outputStyle: 'compressed' })
.on('error', sass.logError))
.pipe(autoprefixer())
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('static/css/'));
});
gulp.task('minify-js', function() {
gulp.src(['static/js/**/*.js', '!static/js/dist/**/*.min.js', '!**/*.min.js'])
.pipe(minify({
ext:{
src:'.js',
min:'.min.js'
},
noSource: true
}))
.pipe(gulp.dest('static/js/dist/'));
});
gulp.task('default', ['sass', 'minify-js']);
gulp.task('dist', ['minify-sass', 'minify-js']);
gulp.task('watch', function() {
gulp.watch('sass/**/*.scss', ['sass']);
});