Install the Node version listed in .nvmrc (use a Node version manager such
as NVM for Mac or NVM for Windows).
- Use
nvm useto install and select the Node version listed in.nvmrc - Use
node -v > .nvmrcto update the file.nvmrcwith the current Node version
In order to use Google Tag Manager and set the SEO defaults follow these steps:
- Add the following three variables to Vercel:
NEXT_PUBLIC_GTM(Your Google Tag Manager ID, e.g.GTM-ABCDE1F)NEXT_PUBLIC_SITE_NAME(Your site name, e.g.Next.js Project Setup)NEXT_PUBLIC_SITE_URL(Your site URL, e.g.https://next-project-setup.jobrodo.nl/)NEXT_PUBLIC_IMAGEKIT(Your Imagekit.io endpoint e.g.https://ik.imagekit.io/jobrodo/)NEXT_PUBLIC_BASE64(A base64-encoded image)
- Install the Vercel CLI with
npm install -g vercel - Connect your project to vercel with
vercel linkand configure credentials accordingly - Pull the environment variables with
vercel env pull
- Use
yarnoryarn installto install the dependencies - Use
yarn cito remove the fileyarn.lockand the directorynode_modulesand reinstall the dependencies - Use
yarn devto start a local dev server at http://localhost:3000 - To build the application for production, use
yarn build - To start a production server, use
yarn start - To export application as static HTML, use
next build && next export - For checking on unused imports, use
yarn find:unused - For analyzing the chunks and modules, use
yarn analyze - For analyzing dependencies in the project, use
yarn depcheck
- To install Vercel CLI use
npm install -g vercel - To connect a project use
vercel linkand configure credentials accordingly - Use
vercel env pullto get the environment variables - Use
vercel devto deploy a local test server at http://localhost:3000 - Use
vercelto deploy a preview build - Use
vercel --prodto deploy a production build