forked from okfde/datenwirken.de
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
34 lines (28 loc) · 1.1 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
var
gulp = require('gulp'),
imagemin = require('gulp-imagemin'),
imageResize = require('gulp-image-resize'),
cache = require('gulp-cache')
changed = require('gulp-changed')
;
gulp.task('default', ['images', 'thumbs', '2k']);
gulp.task('images', function () {
return gulp.src('templates/static/img/banners/*.+(png|jpg|jpeg|gif|svg)')
.pipe(imagemin({
interlaced: true
}))
.pipe(gulp.dest('templates/static/img/banners/min/'))
});
gulp.task('thumbs', function () {
gulp.src('templates/static/img/banners/*.{png,jpg,jpeg}')
.pipe(changed('templates/static/img/banners/thumbs/'))
.pipe(imageResize({width: 600}))
.pipe(gulp.dest('templates/static/img/banners/thumbs/'));
});
gulp.task('2k', function () {
gulp.src('templates/static/img/banners/*.{png,jpg,jpeg}')
.pipe(changed('templates/static/img/banners/sm/'))
.pipe(imageResize({width: 2000}))
.pipe(gulp.dest('templates/static/img/banners/sm/'));
});
// gulp.task('default', ['images', 'thumbnails'], function (){ console.log ('running default task'); });