Skip to content

Commit 603e337

Browse files
committed
fix: components outside of root directory
1 parent 5db14fb commit 603e337

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default function vueNestedSFC(): PluginOption {
3131
/^(.*)(?:\/[^/]+){2}\.vue$/
3232
)!;
3333
if (!importerDir.startsWith(config.root)) {
34-
importerDir = config.root + importerDir;
34+
importerDir = path.resolve(config.root, importerDir);
3535
}
3636
return normalizePath(path.resolve(importerDir, id));
3737
}
@@ -50,7 +50,7 @@ export default function vueNestedSFC(): PluginOption {
5050
const component = match[2];
5151

5252
if (!filename.startsWith(config.root)) {
53-
filename = config.root + filename;
53+
filename = path.resolve(config.root, filename);
5454
}
5555

5656
const descriptor = cache.getDescriptor(filename);

0 commit comments

Comments
 (0)