We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0d3912b commit 5017002Copy full SHA for 5017002
packages/plugin-rsc/src/react/browser.ts
@@ -54,8 +54,10 @@ export function findSourceMapURL(
54
filename: string,
55
environmentName: string,
56
): string | null {
57
- // TODO: respect config.server.origin and config.base?
58
- const url = new URL('/__vite_rsc_findSourceMapURL', window.location.origin)
+ // Respect config.base by using import.meta.env.BASE_URL
+ const base = import.meta.env.BASE_URL.replace(/\/$/, '')
59
+ // Respect asset origin (e.g. server.origin) by using import.meta.url
60
+ const url = new URL(base + '/__vite_rsc_findSourceMapURL', import.meta.url)
61
url.searchParams.set('filename', filename)
62
url.searchParams.set('environmentName', environmentName)
63
return url.toString()
0 commit comments