Hi so when creating a workflow with gulp I can create
a dist folder that used for production, what is the purpose
of using the gulp clean:dist if its just going to delete the folder?
Since we’re generating files automatically, we’ll want to make sure that files that are no longer used don’t remain anywhere without us knowing.
Say in the app folder you have an index.html and an about.html page. You run gulp and those two files get copied into the dist folder. Later on you decide that you don’t need the about.html page after all. You delete it from you app but a copy remains on your dist folder. You could got and remove it yourself but imagine you have many of these files. What gulp clean:dist does is delete the dist folder,
Now Gulp will delete the dist folder for you whenever gulp clean:dist is run.
Also
Note: We don’t have to worry about deleting the dist/images folder because gulp-cache has already stored the caches of the images on your local system.