windows paths aren't handled when parsing
danielroe opened this issue · 3 comments
danielroe commented
parseURL('D:/a/framework/framework/test/fixtures/basic/pages/[...slug].vue?macro=true')
// {
// protocol: '',
// auth: '',
// host: '',
// pathname: '',
// search: '',
// hash: ''
// }
pi0 commented
Behavior of new URL('D:/a/framework/framework/test/fixtures/basic/pages/[...slug].vue?macro=true')
:
hash: ""
host: ""
hostname: ""
href: "d:/a/framework/framework/test/fixtures/basic/pages/[...slug].vue?macro=true"
origin: "null"
password: ""
pathname: "/a/framework/framework/test/fixtures/basic/pages/[...slug].vue"
port: ""
protocol: "d:"
search: "?macro=true"
searchParams: URLSearchParams {}
username: ""
While this is not a valid input, we might improve ufo behavior to be closer to URL.
divine commented
pi0 commented
Supporting windows URLs without file:// protocol can be really tricky. I don't think we can make it better than this. You might use pathToFileURL
from mlly to normalize them before parsing.