fix: fix image config
This commit is contained in:
+1
-1
@@ -28,4 +28,4 @@ DATABASE_URL=""
|
|||||||
# Website Variables
|
# Website Variables
|
||||||
|
|
||||||
NEXT_PUBLIC_SITE_URL="https://entgamers.com"
|
NEXT_PUBLIC_SITE_URL="https://entgamers.com"
|
||||||
IMAGE_DOMAINS="domain.com,another.domain.com"
|
IMAGE_DOMAINS="https://domain.com,http://another.domain.com/route/"
|
||||||
+10
-5
@@ -1,10 +1,15 @@
|
|||||||
|
const imageDomains = (process.env.IMAGE_DOMAINS ?? '').split(',').map(domain => {
|
||||||
|
const getDataRegex = /(?<protocol>[\w]+)?:\/\/(?<hostname>[\w.-]+)?((?<=[\d]{0,4}):(?<port>[\d]{0,4}))?\/?(?<pathname>.*)?$/
|
||||||
|
const groups = getDataRegex.exec(domain).groups ?? {}
|
||||||
|
return groups
|
||||||
|
})
|
||||||
|
|
||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
|
const nextConfig = {
|
||||||
const imageDomains = (process.env.IMAGE_DOMAINS ?? '').split(',').map(domain => domain.trim())
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
reactStrictMode: true,
|
reactStrictMode: true,
|
||||||
images: {
|
images: {
|
||||||
domains: imageDomains
|
remotePatterns: imageDomains
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module.exports = nextConfig
|
||||||
|
|||||||
+1
-2
@@ -1,8 +1,7 @@
|
|||||||
import { defineConfig } from '@pandacss/dev'
|
import { defineConfig } from '@pandacss/dev'
|
||||||
import entGamersPandaPreset from 'entgamers-panda-preset'
|
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
presets: [entGamersPandaPreset],
|
presets: ['entgamers-panda-preset'],
|
||||||
gitignore: true,
|
gitignore: true,
|
||||||
preflight: true,
|
preflight: true,
|
||||||
include: ['./src/**/*.{js,jsx,ts,tsx}'],
|
include: ['./src/**/*.{js,jsx,ts,tsx}'],
|
||||||
|
|||||||
Reference in New Issue
Block a user