forked from htmlacademy-animation/2469617-magic-vacation-1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
32 lines (26 loc) · 806 Bytes
/
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
"use strict";
var gulp = require("gulp");
var rename = require("gulp-rename");
var imagemin = require("gulp-imagemin");
var webp = require("gulp-webp");
var svgstore = require("gulp-svgstore")
gulp.task("images", function() {
return gulp.src("source/img/**/*.{png,jpg,svg}")
.pipe(imagemin([
imagemin.optipng({optimizationLevel: 3}),
imagemin.jpegtran({progressive: true}),
imagemin.svgo()
]))
.pipe(gulp.dest("source/img"));
});
gulp.task("webp", function () {
return gulp.src("source/img/**/*.{png,jpg}")
.pipe(webp({quality: 90}))
.pipe(gulp.dest("source/img"));
});
gulp.task("sprite", function () {
return gulp.src("source/img/*.svg")
.pipe(svgstore({inlineSvg: true}))
.pipe(rename("sprite_auto.svg"))
.pipe(gulp.dest("source/img"));
});