Skip to content

Commit

Permalink
update next.config.js to point images to CDN_DOMAIN
Browse files Browse the repository at this point in the history
  • Loading branch information
rccsousa committed Oct 16, 2024
1 parent a283022 commit a770ed1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ import { withPayload } from '@payloadcms/next/withPayload'
import redirects from './redirects.js'

const NEXT_PUBLIC_SERVER_URL = process.env.NEXT_PUBLIC_SERVER_URL || 'http://localhost:3000'
const CDN_DOMAIN = process.env.CDN_DOMAIN

/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
remotePatterns: [
...[NEXT_PUBLIC_SERVER_URL /* 'https://example.com' */].map((item) => {
...[CDN_DOMAIN /* 'https://example.com' */].map((item) => {
const url = new URL(item)
// console.log('URL IS:',url)

return {
hostname: url.hostname,
Expand Down

0 comments on commit a770ed1

Please sign in to comment.