File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
packages/plugin-rsc/src/react Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -54,8 +54,11 @@ export function findSourceMapURL(
5454 filename : string ,
5555 environmentName : string ,
5656) : string | null {
57- // TODO: respect config.server.origin and config.base?
58- const url = new URL ( '/__vite_rsc_findSourceMapURL' , window . location . origin )
57+ // Respect config.base by using import.meta.env.BASE_URL
58+ // TODO: Handle relative base path.
59+ const base = import . meta. env . BASE_URL . replace ( / \/ $ / , '' )
60+ // Respect asset origin (e.g. server.origin) by using import.meta.url
61+ const url = new URL ( base + '/__vite_rsc_findSourceMapURL' , import . meta. url )
5962 url . searchParams . set ( 'filename' , filename )
6063 url . searchParams . set ( 'environmentName' , environmentName )
6164 return url . toString ( )
You can’t perform that action at this time.
0 commit comments