Fix build

This commit is contained in:
lostinlight 2018-06-05 18:44:58 +03:00
parent 39ca4980b9
commit f70f8ceae3

View file

@ -7,8 +7,6 @@
del = require('../../node_modules/del'),
eslint = require('../../node_modules/gulp-eslint'),
gulp = require('../../node_modules/gulp'),
imagemin = require('../../node_modules/gulp-imagemin'),
jpegRecompress = require('../../node_modules/imagemin-jpeg-recompress'),
notify = require('../../node_modules/gulp-notify'),
plumber = require('../../node_modules/gulp-plumber'),
rename = require('../../node_modules/gulp-rename'),
@ -16,6 +14,7 @@
sass = require('../../node_modules/gulp-sass'),
sourcemaps = require('../../node_modules/gulp-sourcemaps'),
stylelint = require('../../node_modules/gulp-stylelint'),
tinypng = require('../../node_modules/gulp-tinypng-extended'),
uglify = require('../../node_modules/gulp-uglify');
function customPlumber (errTitle) {
@ -104,21 +103,32 @@
});
// Images
gulp.task('images', function() {
return gulp.src('../../source/img/**/*')
.pipe(imagemin([
imagemin.gifsicle(),
jpegRecompress({
loops: 4,
min: 50,
max: 95,
quality:'high'
}),
imagemin.optipng(),
imagemin.svgo()
]))
.pipe(gulp.dest('../../source/img'))
});
// gulp.task('images', function() {
// return gulp.src('../../source/img/**/*')
// .pipe(imagemin([
// imagemin.gifsicle(),
// jpegRecompress({
// loops: 4,
// min: 50,
// max: 95,
// quality:'high'
// }),
// imagemin.optipng(),
// imagemin.svgo()
// ]))
// .pipe(gulp.dest('../../source/img'))
// });
gulp.task('tinypng', function () {
return gulp.src('../../source/img/**/*.{png,jpg,jpeg}')
.pipe(plumber())
.pipe(tinypng({
key: 'API_KEY',
sigFile: 'images/.tinypng-sigs',
log: true
}))
.pipe(gulp.dest('../../source/img'));
});
// Watch
gulp.task('watch', function() {
@ -133,5 +143,5 @@
// Production Mode
gulp.task('build', function (done) {
runSequence('clean', 'styles:build', 'scripts:build', 'vendor', 'images', done);
runSequence('clean', 'styles:build', 'scripts:build', 'vendor', done);
});