Skip to content

Commit 2704e85

Browse files
authoredMar 17, 2025··
fix: generate unique component id (#538)
1 parent 46d3d65 commit 2704e85

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎packages/plugin-vue/src/utils/descriptorCache.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export function createDescriptor(
4040

4141
// ensure the path is normalized in a way that is consistent inside
4242
// project (relative to root) and on different systems.
43-
const normalizedPath = normalizePath(path.relative(root, filename))
43+
const normalizedPath = normalizePath(filename)
4444

4545
const componentIdGenerator = features?.componentIdGenerator
4646
if (componentIdGenerator === 'filepath') {
@@ -49,7 +49,7 @@ export function createDescriptor(
4949
descriptor.id = getHash(normalizedPath + source)
5050
} else if (typeof componentIdGenerator === 'function') {
5151
descriptor.id = componentIdGenerator(
52-
normalizedPath,
52+
normalizePath(path.relative(root, filename)),
5353
source,
5454
isProduction,
5555
getHash,

0 commit comments

Comments
 (0)
Please sign in to comment.