blendid
blendid copied to clipboard
Exclude files / folders from clean task
I'm working on a large site with some extra folders in the root of the website (./public/) with client related stuff. When I build the site with gulp-starter the whole root folder gets cleaned (cleared). Is it possible to set an extra config param to exclude folders / files from the clean task?
Not a bad idea. That's sort of what I created the static
task for, though it was more for things like favicons. You could put all of the persistent client stuff in assets/static
, and it'd just get re-copied over to the root untouched every time.
Or nest your assets in public, so the root dest is something like 'public/assets', and the only the only thing that gets wiped out is that assets
folder.
But I'm open to adding configuration as well. I feel like I started to add that at somepoint but hit some issues and never finished.
I'm certainly in favor of this feature... or instead of deleting the actual config.root.dest folder, perhaps adding config options for the clean task so its possible to negate certain folders...
I will try put something together shortly.
yeah, especially when it wipes out index.php
for your CMS :)
@stevieg83 you can get around that by change your root dest
to something like assets
, so only your assets folder gets wiped out by the clean task.
good shout
We definitely need to address this. There's a couple of routes we could go, and maybe it's a combination of them:
- We can add an exclude folders/files option like @johanneslamers suggested
- Provide an include folders/files option (inverse of above)
- We can also add an option to disable the "clean" step - but that'd create some problems if you're using file revisioning... new files would just keep piling up.
Yes please! I am working on switching over to Blendid from my homegrown build process, but I want to use a customized HTML task to copy my Craft templates to dist/craft/templates
(so I can hard-code the revved asset filenames during build). That means I need to use dist
as my dest folder...which means the clean task wipes out Craft every time. I would probably lean towards whitelisting rather than blacklisting, but either one would work for my purposes.
@elivz why do you need to hard-code the filenames? We included a Craft plugin to handle that automatically: https://github.com/vigetlabs/blendid/blob/master/extras/craft/ASSETS-README.md
@elivz
I would probably lean towards whitelisting rather than blacklisting, but either one would work for my purposes.
Good call, I think that's a probably a better approach.
Well, I guess I don't need to. But it's always seemed cleaner to me to handle all the revisioning in the build process and not have the extra plugin dependency. I already modified the rev task to replace the asset urls in my Twig templates (PR coming...), now I just need to find a way to move those template files outside of the webroot without "cleaning" my entire CMS installation every time.