Commit 25367775 authored by Kit Foster's avatar Kit Foster

Improve config code

parent 14b9c488
...@@ -413,25 +413,9 @@ function assignDefaults( ...@@ -413,25 +413,9 @@ function assignDefaults(
} }
if (images.path === imageConfigDefault.path) { if (images.path === imageConfigDefault.path) {
if ( const prefix = `${result.basePath || ''}${result.experimental?.nextUrlServerPrefix || ''}`
result.basePath && if (prefix && !pathHasPrefix(images.path, prefix)) {
result.experimental?.nextUrlServerPrefix && images.path = `${prefix}${images.path}`
!pathHasPrefix(
images.path,
`${result.basePath}${result.experimental?.nextUrlServerPrefix}`
)
) {
images.path = `${result.basePath}${result.experimental?.nextUrlServerPrefix}${images.path}`
} else if (
result.basePath &&
!pathHasPrefix(images.path, result.basePath)
) {
images.path = `${result.basePath}${images.path}`
} else if (
result.experimental?.nextUrlServerPrefix &&
!pathHasPrefix(images.path, result.experimental?.nextUrlServerPrefix)
) {
images.path = `${result.experimental?.nextUrlServerPrefix}${images.path}`
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment