From bb2f79e09dd4776d611e4751ede1cbb43340fba0 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Sat, 16 Dec 2023 17:31:12 +0100 Subject: fix(build): handle Next.js errors and warnings during build * extract Blog component from BlogPage (paginated) and extract Article component from ArticlePage to avoid `Cannot read properties` errors due to fallback route * fix sitemap build (cjs not supported) * fix eslint warnings (react/jsx-no-literals) * update `start` script since I'm using standalone output * update `postbuild` script since we need to copy public and static files to standalone directory (Next.js does not handle it itself because we should use a CDN...) --- .env.example | 4 ++++ 1 file changed, 4 insertions(+) (limited to '.env.example') diff --git a/.env.example b/.env.example index 12ac09a..5f0c62f 100644 --- a/.env.example +++ b/.env.example @@ -35,6 +35,10 @@ NEXT_PUBLIC_ACKEE_FILENAME="tracker.js" NEXT_PUBLIC_ACKEE_SITE_ID="your-id-string" NEXT_PUBLIC_GITHUB_TOKEN="your-token" +# Use this if you get an error like "Error: 'sharp' is required to be installed +# in standalone mode for the image optimization to function correctly." +#NEXT_SHARP_PATH="node_modules/sharp" + # Use this only in development mode. It prevents "unable to verify the first # certificate" error when using a local domain with mkcert certificate for # backend. -- cgit v1.2.3