Skip to content

Commit ea448f0

Browse files
committed
fix(rsc): ensure ".js" suffix for internal virtual modules
1 parent 5b28ba5 commit ea448f0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/plugin-rsc/src/plugin.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1821,9 +1821,12 @@ export function vitePluginRscCss(
18211821
continue
18221822
}
18231823
}
1824+
1825+
// ensure other plugins treat it as a plain js file
1826+
// e.g. https://github.com/vitejs/rolldown-vite/issues/372#issuecomment-3193401601
18241827
const importId = `virtual:vite-rsc/importer-resources?importer=${encodeURIComponent(
18251828
importer,
1826-
)}`
1829+
)}&lang.js`
18271830

18281831
// use dynamic import during dev to delay crawling and discover css correctly.
18291832
let replacement: string

0 commit comments

Comments
 (0)