HTML
Deployment
Deploy OptimAI production-ready or development files to Vercel.
This guide explains how to deploy OptimAI HTML to Vercel using either:
- Production-ready files (final static output)
- Development files (source code with Vite build)
Prerequisites
- A Vercel account (Sign up)
- A Git repository (GitHub, GitLab, or Bitbucket) for continuous deployment
- Node.js installed locally (only required for local testing and builds)
Pre-deployment checklist
Before deploying, complete these quick checks:
- Choose package type: Confirm whether you are deploying production-ready files or development files.
- Test locally:
- Production-ready: Open
index.htmlin your browser and confirm pages and assets load. - Development: Run
bun run build,yarn build,npm run build, orpnpm buildand confirm the build succeeds.
- Production-ready: Open
- Check paths: Make sure asset paths are correct and not pointing to local file paths.
- Commit latest changes: Push your final updates to your Git branch or repository.
- Confirm root directory: Verify the exact folder you will set as the Vercel root.
Choose your package type
1) Production-ready package
Use this option if you are deploying the folder that already contains final .html files and assets. No build step is needed.
Typical structure:
ai-agency/
├── *.html
├── assets/
├── images/
├── fonts/
└── vendor/
2) Development package
Use this option if you are deploying the source project with src/, public/, and Vite configuration.
Typical structure:
ai-agency-tailwind/
├── src/
├── public/
├── *.html
├── package.json
└── vite.config.js
Deployment method: Vercel Dashboard
Import your repository
- Sign in at vercel.com
- Click New Project
- Import your Git repository
- Select the repository or folder you want to deploy
Configure settings based on package type
A) Production-ready package settings
- Framework preset:
Other - Root directory:
./(or the production folder path) - Build command: leave empty
- Output directory: leave empty
- Install command: leave empty
Vercel will serve files directly from your project root as a static site.
B) Development package settings
- Framework preset:
Vite - Root directory:
./(or the development folder path) - Install command:
bun install,yarn install,npm install, orpnpm install - Build command:
bun run build,yarn build,npm run build, orpnpm build - Output directory:
dist
Make sure your package.json includes a valid build script, for example:
{
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
}
}
Deploy
- Click Deploy
- Wait for deployment to complete
- Open the generated Vercel URL to verify your site
Verify after deployment
After the first deployment, validate the live site:
- Open the homepage and 3-5 inner pages
- Check that CSS and JavaScript are loading correctly
- Verify images, icons, and fonts render properly
- Test navigation and menu links
- Open browser dev tools and confirm there are no critical console or network errors ::::
Deployment method: Vercel CLI
Install the CLI
Terminal
npm i -g vercel
Log in
Terminal
vercel login
Deploy from your project directory
Terminal
cd your-project-directory
vercel
Complete Vercel prompts
- During prompts:
- For a production-ready package, choose static or default settings with no build command
- For a development package, set the build command and output directory (
dist)
Final verification
- Confirm and complete deployment.
- Verify the deployment URL using the same checklist in Verify after deployment. ::::
Common issues and fixes
- Blank page or broken styles: Check asset paths and confirm static files exist in the deployed root or output directory.
- Build failed: Confirm dependencies are installed and the
buildscript exists inpackage.json. - 404 on refresh (inner pages): Verify routing and file structure, especially when using direct
.htmlpage links. - Wrong folder deployed: Recheck the Vercel Root directory setting.
- Old content still showing: Trigger a redeploy after pushing latest commits.
Notes and best practices
- If your repository contains both package types, deploy each one as a separate Vercel project.
- Use the production-ready package for the fastest deployment with no build process.
- Use the development package when you want CI builds and source-level updates on each push.