When I’m done working on my project, I run gulp --production.
But is there a way to go back to the situation before I ran gulp --production?
Right now I run the deployment and start further work on remote server. With all files being compiled, this is not what I would want. Let alone working on a live-site.
I know there are ways to go to Github and all, but I’m new to that and after hours of comming this far, I was hoping for an accaptable way to work around this? Becides that, the documentation advises to run the --production flag, so if you would work with version controle etc., you would also have to be able to go back to all uncompiled stuff right?
Probably missing a piece of the puzzle. But hope you can explain me a little bit.
The missing puzzle is probably that
gulp --production compiles css/js images etc. into /dist folder and WordPress with the help of some code in Sage automatically knows to use those files after. You still keep all the scss files intact etc.
So the live site also uses the /dist folder. You never ever do any changes to /dist folder as gulp does it’s own magic in there automatically deleting it and updating etc.
After you run
gulp --production and you want to go back to the “development mode” of the theme, just run
gulp && gulp watch. Running gulp only created the developer /dist with maps etc. and gulp watch does the localhost proxy for live updates etc.
This may also be a reason why running gulp watch right after gulp --production you don’t see any theme changes. So remember to run
gulp when you want to do changes follower by
Thanks for taking the time to explain. Very helpfull.