- Edit the root source files only.
- Do not manually edit anything inside
publish/. - Treat
publish/as generated deploy output, similar to adist/folder.
- Make changes in root files such as
index.html,chem.css,chem.js, andnetlify/functions/*. - Review changes with
git status. - Commit and push only the root source changes.
Example:
git status
git add index.html chem.css netlify.toml
git commit -m "Improve homepage hero spacing"
git push- Netlify build command:
npm run publish:prep - Netlify publish directory:
publish - Netlify functions directory:
netlify/functions
This means Netlify will:
- Build a clean deploy copy into
publish/ - Serve only the generated
publish/output - Keep functions sourced from
netlify/functions
If you want to inspect the generated deploy output locally:
npm run publish:prepAfter that, publish/ should be considered disposable. If a file differs between the root and publish/, the root file is the one you should edit.