Skip to content

Latest commit

 

History

History
71 lines (52 loc) · 1.13 KB

DEPLOYING.md

File metadata and controls

71 lines (52 loc) · 1.13 KB

Deploying

Deploy app to Vercel.

vercel deploy

(Optional) Deploying Static Exports next.config.js:

module.exports = {
  output: 'export',
  exportTrailingSlash: true,
  assetPrefix: '/out',
}

Dependency packages in production for deployment on Vercel hosting.

npm install @vercel/analytics

(Optional) Vercel Speed Insights package

npm install @vercel/speed-insights

(Optional) Image Optimization

Usage image component

import Image from 'next/image'

export default function Page() {
  return <Image />
}

Set image element rules in .eslintrc.js:

module.exports = {
  rules: {
    '@next/next/no-img-element': 'warn',
  }
}

(Optional) Add cron jobs

vim vercel.json
{
  "crons": [
    {
      "path": "/api/cron/daily-reset-posts",
      "schedule": "0 0 * * *"
    }
  ]
}