From 3c8c92380633f09a58c8dab20dd5bc5cbd107970 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Wed, 14 Feb 2024 12:55:31 -0600 Subject: [PATCH] Code cleanup --- next.config.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/next.config.js b/next.config.js index 622bcafa..f0ff1b30 100644 --- a/next.config.js +++ b/next.config.js @@ -2,14 +2,14 @@ const VERCEL_BLOB_STORE_ID = process.env.BLOB_READ_WRITE_TOKEN?.match( /^vercel_blob_rw_([a-z0-9]+)_[a-z0-9]+$/i, )?.[1].toLowerCase(); -const VERCEL_BLOB_HOSTNAME = VERCEL_BLOB_STORE_ID +const HOSTNAME_VERCEL_BLOB = VERCEL_BLOB_STORE_ID ? `${VERCEL_BLOB_STORE_ID}.public.blob.vercel-storage.com` : undefined; -const CLOUDFLARE_R2_HOSTNAME = +const HOSTNAME_CLOUDFLARE_R2 = process.env.NEXT_PUBLIC_CLOUDFLARE_R2_PUBLIC_DOMAIN; -const AWS_S3_HOSTNAME = +const HOSTNAME_AWS_S3 = process.env.NEXT_PUBLIC_AWS_S3_BUCKET && process.env.NEXT_PUBLIC_AWS_S3_REGION // eslint-disable-next-line max-len @@ -30,9 +30,9 @@ const nextConfig = { images: { imageSizes: [200], remotePatterns: [] - .concat(createRemotePattern(VERCEL_BLOB_HOSTNAME)) - .concat(createRemotePattern(CLOUDFLARE_R2_HOSTNAME)) - .concat(createRemotePattern(AWS_S3_HOSTNAME)), + .concat(createRemotePattern(HOSTNAME_VERCEL_BLOB)) + .concat(createRemotePattern(HOSTNAME_CLOUDFLARE_R2)) + .concat(createRemotePattern(HOSTNAME_AWS_S3)), minimumCacheTTL: 31536000, }, };