fix: fix image config
This commit is contained in:
+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} */
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user