-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image task not copying some images over to dist? #579
Comments
After removing $.cache it seems to have worked, wish I tried that before posting. this
to
|
Thanks for posting back about the caching issues you ran into. You shouldn't have to disable |
@bluematter Long shot, but are all your images in the in the |
I haven't been able to reproduce this issue. Is anyone else running into this issue with gulp-cache? I've been reading up on jgable/gulp-cache#16 but that issue is closed. |
Sorry guys, totally forgot about this, if can remember correctly, when I initially started having this issue all the images were indeed in the I went ahead and manually compressed my images with compressor.io. That said I avoid using many images so I haven't really focused on this issue, I just left the task without the All I remember is at the time it was a pain, I will see what happens when I add |
Encountered the same issue in combination with Jenkins, same setup as described above. |
Same problem here. |
What helped in my case was clearing the cache. Once I did that I've had no more problems (for now). Does this also help someone else? Maybe gulp-newer is an alternative for this task? |
Hey Guys, I have the same problem here. Looking for a solution, I tried this code and it worked: // Optimize Images
gulp.task('images', function () {
return gulp.src('app/images/**/*.{gif,jpg,png,svg}')
.pipe($.cache($.imagemin({
progressive: true,
interlaced: true,
pngquant: true
})))
.pipe(gulp.dest('dist/images'))
.pipe($.size({title: 'images'}));
}); |
This fixed google#579. Somewhat recently, the gulp-cache repository made some changes that made sending files not easily managed by gulp-cache a much simpler pill to swallow. That's definitely changing (they're fixing problems, to be clear) and short of a simple gulp.src nodir+follow option, using the included gulp-if plugin to drop out of the file stream the base directories makes the gulp file work super smoothly. Hope it helps!
… gulp.src base directories for image glob Take a gander at google#636 for a few more details. This fix might work in a lot of branches, frankly, but the material-sprint branch is where I first ran into issues. Hopefully it helps! (And this fixes google#579.)
Hola. Looks like the gulp.src function was sending along base directories (e.g., app/images/icon) and this was causing a freshly tightened gulp-cache to choke on generating a key for a file that it could not understand. Using gulp-if and it's direct relationship with gulp-match, you can comfortably drop out the base directories from the image optimization pipeline before you run into problems. This is a bit of an annoying problem (globs suck, the gulp-cache plugin needs friends, and it looks like a lot of people hack their way around this problem), but I bet this kind of pattern feels right -- you're checking to see if you're reviewing a file before you start trying to process a file. Poke me with questions! Hope this helps! |
@PavanGupta nice! thks. |
:), happy to help! |
Fixed in jgable/gulp-cache#43. |
@shinnn you guys are awesome! pull requests closed! |
Thanks for fixing this! I was still having the issue even after upgrading all of the node dependencies. The key was what @webwelten suggested. You have to clear the cache to get rid of bad entries or else you will still get the missing files in your dist build. |
This can also be closed :) |
Closing! :D |
Doesn't seem to work after pulling master today... |
I have been struggling with gulp-imagemin for the past few days, one it will not compress the images, I am basing that off the images being the same file size and page speed insights telling me to compress them, this is not a big deal as I don't use many images and can manually compress them, just thought I would mention this.
The thing that gets me is why certain images are not being copied over into the dist build. This has happened to me on numerous occasions over the past few days. I tried clearing the gulp-cache
I am not sure what else I can add, I doubt this is enough to help troubleshoot, but has anyone else experienced this, perhaps I am doing something wrong?
The text was updated successfully, but these errors were encountered: