The docs say: https://docs.netlify.com/configure-builds/overview/
Publish directory: Directory (relative to the root of your repo) that contains the deploy-ready HTML files and assets generated by the build. If a base directory has been specified, it should be included in the publish directory path. For example, if your base directory is set to site, the publish directory should include the site/ prefix like so: site/public. Visit the common configurations doc to learn about typical settings for popular tools and architectures.
My question, why do I care what the directory is suppose to be? Isn't it all auto-generated somewhere?!
You're absolutely correct. The publish directory is automatically generated for each SSG (Static Site Generator). Now there are 2 reasons, why you need to specify it:
The default publish directory for each SSG is different. For example,
public
_site
so on & so forth for each SSG.
All these SSGs allow you to change the default name of the publish directory as well. For example,
--destination
flag--destination
flagSo, how does Nelify know what's the name of your publish directory ? Therefore it becomes necessary to specify the publish directory based on your SSG & your setup.