Skip to content

Commit

Permalink
don't use path prefix for alternate image cdn url
Browse files Browse the repository at this point in the history
  • Loading branch information
pieh committed Nov 13, 2023
1 parent 36b918a commit eb242c6
Showing 1 changed file with 1 addition and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export function generateImageUrlAlt(
const placeholderOrigin = `http://netlify.com`
const imageParams = generateImageArgsAlt(imageArgs)

const baseURL = new URL(`${placeholderOrigin}/${generateRoutePrefix(store)}`)
const baseURL = new URL(`${placeholderOrigin}/.netilfy/images`)

baseURL.search = imageParams.toString()
baseURL.searchParams.append(`url`, source.url)
Expand All @@ -198,16 +198,6 @@ export function generateImageUrlAlt(
return `${baseURL.pathname}${baseURL.search}`
}

function generateRoutePrefix(store?: Store): string {
const state = store?.getState()

const pathPrefix = state?.program?.prefixPaths
? state?.config?.pathPrefix
: ``

return pathPrefix + `.netlify/images`
}

export function generateImageArgsAlt({
width,
height,
Expand Down

0 comments on commit eb242c6

Please sign in to comment.