mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 00:52:01 +00:00
fix: ensure importer is normalised before resolving relative imports
This commit is contained in:
parent
6133fe62d6
commit
1a375d638c
@ -43,6 +43,9 @@ export const VirtualFSPlugin = (nuxt = useNuxt(), options: VirtualFSPluginOption
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (importer && !isAbsolute(id)) {
|
if (importer && !isAbsolute(id)) {
|
||||||
|
if (importer.startsWith(PREFIX)) {
|
||||||
|
importer = importer.slice(PREFIX.length)
|
||||||
|
}
|
||||||
const resolved = resolveWithExt(join(dirname(importer), id))
|
const resolved = resolveWithExt(join(dirname(importer), id))
|
||||||
if (resolved) {
|
if (resolved) {
|
||||||
return PREFIX + resolved
|
return PREFIX + resolved
|
||||||
|
Loading…
Reference in New Issue
Block a user