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