Skip to content

Commit 9f53d28

Browse files
committed
fix: normalize domains to hostname (resolves nuxt#486)
1 parent d7bb617 commit 9f53d28

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { resolve } from 'upath'
22
import defu from 'defu'
3-
import { parseURL, withLeadingSlash } from 'ufo'
3+
import { withLeadingSlash } from 'ufo'
44
import LruCache from 'lru-cache'
55
import type { Module } from '@nuxt/types'
66
import { setupStaticGeneration } from './generate'
@@ -40,7 +40,7 @@ const imageModule: Module<ModuleOptions> = async function imageModule (moduleOpt
4040

4141
// Normalize domains to hostname
4242
options.domains = options.domains
43-
.map(domain => parseURL(domain, 'https://').host)
43+
.map(domain => new URL(domain, 'https://').hostname)
4444
.filter(Boolean) as string[]
4545

4646
// Normalize alias to start with leading slash

0 commit comments

Comments
 (0)