[TASK] thumbnail-task
This commit is contained in:
parent
8f108f63be
commit
a54748e6a7
29
gulpfile.js
29
gulpfile.js
@ -38,6 +38,10 @@ const paths = {
|
|||||||
src: 'src/images/*.jpg',
|
src: 'src/images/*.jpg',
|
||||||
dest: 'dist/images/'
|
dest: 'dist/images/'
|
||||||
},
|
},
|
||||||
|
thumbnails: {
|
||||||
|
src: 'src/images/*.jpg',
|
||||||
|
dest: 'dist/images/thumbs'
|
||||||
|
},
|
||||||
html: {
|
html: {
|
||||||
src: 'src/*.html',
|
src: 'src/*.html',
|
||||||
dest: 'dist/'
|
dest: 'dist/'
|
||||||
@ -83,6 +87,27 @@ function images() {
|
|||||||
.pipe(dest(paths.images.dest));
|
.pipe(dest(paths.images.dest));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function thumbnails() {
|
||||||
|
return src(paths.thumbnails.src)
|
||||||
|
.pipe(newer(paths.thumbnails.dest))
|
||||||
|
.pipe(imageResize({
|
||||||
|
width: 50,
|
||||||
|
height: 50,
|
||||||
|
crop: false,
|
||||||
|
upscale: false
|
||||||
|
}))
|
||||||
|
.pipe(imagemin({
|
||||||
|
progressive: true,
|
||||||
|
optimizationLevel: 5,
|
||||||
|
svgoPlugins: [{
|
||||||
|
removeViewBox: false
|
||||||
|
}, {
|
||||||
|
removeUselessStrokeAndFill: false
|
||||||
|
}]
|
||||||
|
}))
|
||||||
|
.pipe(dest(paths.thumbnails.dest));
|
||||||
|
}
|
||||||
|
|
||||||
function js() {
|
function js() {
|
||||||
return src(paths.scripts.src)
|
return src(paths.scripts.src)
|
||||||
.pipe(uglify())
|
.pipe(uglify())
|
||||||
@ -172,7 +197,7 @@ function favicon() {
|
|||||||
.pipe(dest(paths.html.dest + "favicons/"));
|
.pipe(dest(paths.html.dest + "favicons/"));
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.images = parallel(images);
|
exports.images = parallel(images, thumbnails);
|
||||||
exports.favicon = series(favicon, manifest);
|
exports.favicon = series(favicon, manifest);
|
||||||
exports.default = series(parallel(html, pdf, series(favicon, manifest)), js, series(scss, css), images);
|
exports.default = series(parallel(html, pdf, series(favicon, manifest)), js, series(scss, css), parallel(images, thumbnails));
|
||||||
exports.serve = series(serve);
|
exports.serve = series(serve);
|
||||||
Loading…
x
Reference in New Issue
Block a user