Skip to content

Commit 72d05d0

Browse files
committed
fix: warning
1 parent 5c23694 commit 72d05d0

File tree

1 file changed

+10
-1
lines changed
  • packages/plugin-rsc/src/plugins

1 file changed

+10
-1
lines changed

packages/plugin-rsc/src/plugins/cjs.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ import { transformCjsToEsm } from '../transforms/cjs'
88

99
export function cjsModuleRunnerPlugin(): Plugin[] {
1010
// use-sync-external-store is known to work fine so don't show warning
11-
const warnedPackages = new Set<string>(['use-sync-external-store'])
11+
const warnedPackages = new Set<string>([
12+
'use-sync-external-store',
13+
'react',
14+
'react-dom',
15+
'@vitejs/plugin-rsc',
16+
])
1217

1318
return [
1419
{
@@ -74,6 +79,10 @@ export function cjsModuleRunnerPlugin(): Plugin[] {
7479
}
7580

7681
function extractPackageKey(id: string): string {
82+
if (id.includes('/packages/plugin-rsc/dist/vendor/react-server-dom/')) {
83+
return '@vitejs/plugin-rsc'
84+
}
85+
7786
// .../.yarn/cache/abc/... => abc
7887
const yarnMatch = id.match(/\/.yarn\/cache\/([^/]+)/)
7988
if (yarnMatch) {

0 commit comments

Comments
 (0)