diff --git a/.env.example b/.env.example index 2033185..b3ac8b6 100644 --- a/.env.example +++ b/.env.example @@ -28,4 +28,4 @@ DATABASE_URL="" # Website Variables NEXT_PUBLIC_SITE_URL="https://entgamers.com" -IMAGE_DOMAINS="domain.com,another.domain.com" \ No newline at end of file +IMAGE_DOMAINS="https://domain.com,http://another.domain.com/route/" \ No newline at end of file diff --git a/next.config.js b/next.config.js index 78f77f4..f7de370 100644 --- a/next.config.js +++ b/next.config.js @@ -1,10 +1,15 @@ +const imageDomains = (process.env.IMAGE_DOMAINS ?? '').split(',').map(domain => { + const getDataRegex = /(?[\w]+)?:\/\/(?[\w.-]+)?((?<=[\d]{0,4}):(?[\d]{0,4}))?\/?(?.*)?$/ + const groups = getDataRegex.exec(domain).groups ?? {} + return groups +}) + /** @type {import('next').NextConfig} */ - -const imageDomains = (process.env.IMAGE_DOMAINS ?? '').split(',').map(domain => domain.trim()) - -module.exports = { +const nextConfig = { reactStrictMode: true, images: { - domains: imageDomains + remotePatterns: imageDomains } } + +module.exports = nextConfig diff --git a/panda.config.ts b/panda.config.ts index 39d3c07..b2f4a59 100644 --- a/panda.config.ts +++ b/panda.config.ts @@ -1,8 +1,7 @@ import { defineConfig } from '@pandacss/dev' -import entGamersPandaPreset from 'entgamers-panda-preset' export default defineConfig({ - presets: [entGamersPandaPreset], + presets: ['entgamers-panda-preset'], gitignore: true, preflight: true, include: ['./src/**/*.{js,jsx,ts,tsx}'],