Skip to content

Commit

Permalink
Adjust image domains
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish committed Nov 24, 2023
1 parent cf154c3 commit 8e33574
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -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})
}

Expand Down Expand Up @@ -71,6 +66,7 @@ const nextConfig = {
];
},
};

if (process.env.NODE_ENV === 'development') {
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
Expand Down

0 comments on commit 8e33574

Please sign in to comment.