From 8e335748b21dfb93b08c839774346e773a0a1fb5 Mon Sep 17 00:00:00 2001 From: Mike Decker Date: Thu, 23 Nov 2023 17:12:45 -0800 Subject: [PATCH] Adjust image domains --- next.config.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/next.config.js b/next.config.js index 0f6b9d9f..71d9817d 100644 --- a/next.config.js +++ b/next.config.js @@ -1,17 +1,12 @@ const drupalUrl = new URL(process.env.NEXT_PUBLIC_DRUPAL_BASE_URL); const imagePatterns = [ - { - // Allow any stanford domain for images, but require https. - protocol: 'https', - hostname: '**.stanford.edu', - }, { protocol: drupalUrl.protocol.replace(':', ''), hostname: drupalUrl.hostname, }, ]; -if (process.env.NEXT_IMAGE_DOMAIN) { +if (process.env.NEXT_IMAGE_DOMAIN && drupalUrl.hostname !== process.env.NEXT_IMAGE_DOMAIN) { imagePatterns.push({hostname: process.env.NEXT_IMAGE_DOMAIN}) } @@ -71,6 +66,7 @@ const nextConfig = { ]; }, }; + if (process.env.NODE_ENV === 'development') { const withBundleAnalyzer = require('@next/bundle-analyzer')({ enabled: process.env.ANALYZE === 'true',