Netlify

Easy Static Deployments to Netlify

  1. Install and authorise netlify-cli

brew install netlify-cli
netlify login
  1. If your app uses React Router, create a netlify.toml file in the root of your app and paste this in

[[redirects]]
  from="/*"
  to="/"
  status=200
  1. Compile a production build of your app

npm run build
  1. Test your production build locally (optional)

npm run preview
  1. Deploy the production build

netlify deploy --prod --dir dist
  1. Compile and deploy if compile succeeds:

npm run build && netlify deploy --prod --dir dist

Other Options

https://vitejs.dev/guide/static-deploy.html

Last updated