Deployment
Each server has different functionality and deployment configuration.
Make sure you have configured it correctly according to your service provider's instructions.
Netlify
CRA
- Create file
_redirects
inpublic
folder. - Create file
netlify.toml
in root project.
/* /index.html 200
[build]
command = "yarn build"
publish = "build"
Next.js
- Update in
package.json
. - Create file
netlify.toml
in root project. - Connect with git and deploy.
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"build-netlify": "next build && cp -r .next _next && mv _next .next/",
},
[build]
command = "npm run build-netlify"
publish = ".next"
[[plugins]]
package = "@netlify/plugin-nextjs"