Skip to content

Commit

Permalink
feat(vercel): remove protocol from vercel domains
Browse files Browse the repository at this point in the history
closes #242
  • Loading branch information
danielroe committed Apr 28, 2021
1 parent c11946f commit 086227c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/provider.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { normalize, resolve, dirname } from 'upath'
import { writeJson, mkdirp } from 'fs-extra'
import { parseURL } from 'ufo'
import type { ModuleOptions, InputProvider, ImageModuleProvider, ProviderSetup } from './types'
import { hash } from './utils'

Expand All @@ -21,7 +22,7 @@ export const providerSetup: Record<string, ProviderSetup> = {
const imagesConfig = resolve(nuxt.options.rootDir, '.vercel_build_output/config/images.json')
await mkdirp(dirname(imagesConfig))
await writeJson(imagesConfig, {
domains: moduleOptions.domains,
domains: moduleOptions.domains.map(domain => parseURL(domain).host),
sizes: Array.from(new Set(Object.values(moduleOptions.screens || {})))
})
}
Expand Down

0 comments on commit 086227c

Please sign in to comment.