Skip to content

Commit bb39264

Browse files
committed
fix: replace more
1 parent 21c8cd6 commit bb39264

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/plugin-rsc/src/plugin.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,10 @@ function hashString(v: string) {
947947
return createHash('sha256').update(v).digest().toString('hex').slice(0, 12)
948948
}
949949

950-
function normalizeReferenceId(id: string, name: 'client' | 'rsc') {
950+
function normalizeReferenceId(
951+
id: string,
952+
name: 'client' | 'rsc' | (string & {}),
953+
) {
951954
if (!server) {
952955
return hashString(path.relative(config.root, id))
953956
}
@@ -1022,6 +1025,7 @@ export function vitePluginUseClient(
10221025
} else {
10231026
if (this.environment.mode === 'dev') {
10241027
importId = normalizeViteImportAnalysisUrl(
1028+
// TODO
10251029
server.environments.client,
10261030
id,
10271031
)
@@ -1265,7 +1269,8 @@ export function vitePluginUseServer(
12651269
// module identity of `import(id)` like browser, so we simply strip it off.
12661270
id = id.split('?v=')[0]!
12671271
}
1268-
normalizedId_ = normalizeReferenceId(id, 'rsc')
1272+
// TODO
1273+
normalizedId_ = normalizeReferenceId(id, serverEnvironments[0]!)
12691274
}
12701275
return normalizedId_
12711276
}

0 commit comments

Comments
 (0)