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

Fixes #300 by segregating source from destination #304

Closed
wants to merge 1 commit into from

Conversation

garretthyder
Copy link
Collaborator

This fix avoids the infinite loop of imagemin when watching

@JeremyEnglert
Copy link
Owner

This PR really got me thinking about the file structure.

We have three directories where the bulk of the assets are:

  • /assets/styles
  • /assets/scripts
  • /assets/images

The compiled/minified files are in those directories, while the working files are a directory deeper. This is consistent across these directories - which is great. But would it make more sense to have the compiled/minified files be the "deeper" files?

  • /assets/styles (this holds the SCSS files)
  • /assets/styles/css (this holds the minified files)
  • /assets/scripts (this holds the individual script files)
  • /assets/scripts/js (this holds the minified files)
  • /assets/images (this holds the unminified files)
  • /assets/images/minified (this holds the minified images)

@garrett-eclipse, I'd love your thoughts on this. z

@garretthyder
Copy link
Collaborator Author

Thanks @JeremyEnglert imho I feel even more distinction would be beneficial this would make it easier to check in only the source and push to production without the source files.

I'm thinking something like;
/source/styles (this holds the SCSS files)
/assets/css (this holds the minified files)
/source/scripts (this holds the js partials)
/assets/js (this holds the minified files)
/source/images (this holds the original images)
/assets/img (this holds the optimized images)

Thinking with this structure your .gitignore can exclude the entire /assets directory. And if you have a deploy script you can have it exclude the entire source directory.

Just my two cents

@jackfearing
Copy link

This fix works for me however I was wondering if there was a way to setup a remove task which watches the src folder and if the image is not in the src folder then remove it from the optimized images folder?

@garretthyder
Copy link
Collaborator Author

Thanks @jackfearing that's a good idea, can you spawn a unique ticket for that request so it can be accommodated properly. Cheers

@jackfearing
Copy link

Thanks Garrett -- just submitted a new ticket. #360

@garretthyder
Copy link
Collaborator Author

Sorry I messed up my PRs by using my master. Closing this to cleanup and reopen via a branch.

@garretthyder
Copy link
Collaborator Author

Created PR #312 to replace this. @JeremyEnglert I didn't find the gulp-improvements branch yet. When that's setup will you handle the further separation of directories as discussed in this PR?

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

Successfully merging this pull request may close these issues.

None yet

3 participants