Vercel
To deploy on Vercel, we need to make some package changes and adjust the Astro config file.
- Install the
@astrojs/vercel
adapter and uninstall the@astrojs/netlify
adapter - Adjust the
astro.config.mjs
file for Vercel deployment - You can also delete the
netlify.toml
file
Project Adjustments
Packages
- Install the
@astrojs/vercel
adapter withnpm install @astrojs/vercel
- Uninstall the
@astrojs/netlify
adapter withnpm uninstall @astrojs/netlify
Gitignore
It is recommended to add the local Vercel folder to your .gitignore
file as these files are not necessary for your repository:
Config File
Make the following adjustments to the astro.config.mjs
file for Vercel deployment:
Test Build
Before deploying, it is recommended to test the build locally with npm run build
to ensure everything is working as expected.
Deploying
- Push your code to GitHub
- Create a Vercel account if you don’t already have one
- Follow the official Vercel documentation to deploy your site