Skip to content
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

Imagemin Infinite Loop #300

Closed
donaldG opened this issue Dec 11, 2017 · 10 comments
Closed

Imagemin Infinite Loop #300

donaldG opened this issue Dec 11, 2017 · 10 comments

Comments

@donaldG
Copy link

donaldG commented Dec 11, 2017

If I remove an image from the /assets/images/ directory while gulp watch is running then the imagemin task gets stuck in an infinite loop. Wondering if there just needs to be a separate raw/distro directory for images? I know that creates some duplication but not sure what else is going on with that task. My best guess is the task is modifying the directory, it's also watching the directory for changes, so then it gets stuck: watching, modifying, watching, etc...

@anyway
Copy link

anyway commented Dec 15, 2017

Same here... I can confirm the issue.

@garretthyder
Copy link
Collaborator

I wonder if this has to do with the fact we're watching the files twice as was noticed in #282 Can you take a look at PR #303 and apply that fix to your gulpfile.js and see if that has any effect. Thanks

@donaldG
Copy link
Author

donaldG commented Dec 15, 2017

@garrett-eclipse good thought but didn't work. Tried the PR @ #303 with no luck. The only thing I've gotten to work thus far is around line 60 changing, images: 'assets/images/**/*', to images: 'assets/images/src/**/*', and adding that \src\ directory manually.

@garretthyder
Copy link
Collaborator

Reading into some articles you're right we'll probably need to separate the source from the destination or we'll always have an infinite loop.

So as you mentioned setting up the /src directory inside assets/images and then having that be the SOURCE on line 60 is the right approach to avoid this.

garretthyder pushed a commit to garretthyder/JointsWP that referenced this issue Dec 15, 2017
@garretthyder
Copy link
Collaborator

I've put together PR #304 to resolve this issue. Cheers

@garretthyder
Copy link
Collaborator

I messed up PR #304 so have replaced with PR #312

@johnw6761
Copy link

Has this been resolved, I still have this issue?

@donaldG
Copy link
Author

donaldG commented Apr 5, 2018 via email

@JeremyEnglert
Copy link
Owner

I'll work on getting this merged this weekend.

But @donaldG's comment may be the funniest thing I've read all day.

@garretthyder
Copy link
Collaborator

Sorry I've been tied up for a bit, I've merged this into core @johnw6761 please pull the latest and let me know if you have any conflicts, the main change there was migrating images into a segregated src child folder so make sure any custom images are at that level to be optimized.
Closing for now, reopen if you have any issues.
*And @donaldG kudos that split my sides

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants