Gulp cannot create an img folder in the dist folder. Everything goes without errors, but the folder does not appear!
`const srcPath = “src/”
const distPath = “dist/”
const path = {
build: {
html: distPath,
css: distPath + “css”,
js: distPath + “js”,
images: distPath + “images”,
fonts: distPath + “fonts”
},
src: {
html: srcPath + “.html”,
css: srcPath + “scss/.scss”,
js: srcPath + “js/.js”,
images: srcPath + “images/**/.(jpg, png, svg, gif, ico, webp)”,
fonts: “srcPath + font/**/*.(woff, woff2, eot, ttf, svg)”
}
}
function images() {
return src(path.src.images, { base: srcPath + “images/” })
.pipe(imagemin(
[
imagemin.gifsicle({ interlaced: true }),
imagemin.mozjpeg({ quality: 85, progressive: true }),
imagemin.optipng({ optimizationLevel: 5 }),
imagemin.svgo({
plugins: [
{
name: 'removeViewBox',
active: true
},
{
name: 'cleanupIDs',
active: false
}
]
})
]
))
.pipe(dest(path.build.images))
}
exports.images = images`
[19:51:14] Starting 'images'... [19:51:14] gulp-imagemin: Minified 0 images [19:51:14] Finished 'images' after 157 ms
I looked through the code, but didn’t find any errors in the names, I tried running the function without a plugin, the same result
Виталий Кравченко is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.