Skip to content

Commit b0966d1

Browse files
committed
add shims at the start
1 parent ab8806d commit b0966d1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

packages/vite/src/plugins/vite-plugin-rsc-transform-entry.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ globalThis.__webpack_require__ ||= (id) => {
2121

2222
return {
2323
name: 'rsc-transform-entry',
24-
transform: async function (code, id) {
25-
if (id === entryServerPath || id === entryClientPath) {
26-
return code + rscWebpackShims
24+
banner: (chunk) => {
25+
if (
26+
chunk.facadeModuleId === entryServerPath ||
27+
chunk.facadeModuleId === entryClientPath
28+
) {
29+
return rscWebpackShims
2730
}
28-
29-
return code
31+
return ''
3032
},
3133
}
3234
}

0 commit comments

Comments
 (0)