For Visual Studio 2019, I managed to exclued a wwwroot subfolder named "dummy" (including all subfolders of "dummy") from publish output using the following code:
Never
Note: The requirement was to keep the wwwroot and its subfolder(s) included in project but just exclude while publishing.