The best ZIP for a static host opens immediately to index.html, not to a folder containing it. Build the publish folder first, then compress its contents.
macOS Finder
- Open the folder that contains
index.html. - Select
index.htmland every asset folder. - Right-click and choose Compress.
- Open the created archive once and confirm
index.htmlis the first-level file.
Windows Explorer
- Open the finished publish folder.
- Select its contents, not the parent folder.
- Right-click → Send to → Compressed (zipped) folder.
- Open the ZIP and check that the homepage is visible immediately.
Linux terminal
cd /path/to/publish
zip -r ../my-site.zip . -x "*.DS_Store" -x "__MACOSX/*"
The trailing dot means “zip this folder’s contents.” Before upload, inspect it:
unzip -l ../my-site.zip | head -n 20
Keep the archive clean
Exclude node_modules, editor folders, .git, source maps you do not intend to publish, API keys, and .env files. For a React/Vue/Astro project, run its build command and zip the generated dist or build output—not the project source folder.