Dependencies:
- node@18
- npm@8
npm ci
Proper way:
npm start
Alternative way (to test the vercel function directly):
npm run vercel
Note: in this approach the nextjs app and vercel functions will work, but the serverless functions in nextjs app will not!
Run npm run test
to check for linting and type errors.
Deployment is set up after each commit to the master
branch.
There is an issue with a too large function for a lambda. To solve this issue we must use Vercel function directly (saves ~10MB).
This in order does not work in local development, so:
- In dev we import code from original function
- During deploy, before building, the stub is removed by running
rm pages/api/getPreview.ts
in Vercel CI/CD.