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.
BASE_URL
1 parent 1b4e0f0 commit e5b4694Copy full SHA for e5b4694
1 file changed
packages/plugin-rsc/src/browser.ts
@@ -10,7 +10,9 @@ function initialize(): void {
10
load: async (id) => {
11
if (!import.meta.env.__vite_rsc_build__) {
12
// @ts-ignore
13
- return __vite_rsc_raw_import__(import.meta.env.BASE_URL + id.slice(1))
+ return __vite_rsc_raw_import__(
14
+ withTrailingSlash(import.meta.env.BASE_URL) + id.slice(1),
15
+ )
16
} else {
17
const import_ = clientReferences.default[id]
18
if (!import_) {
@@ -21,3 +23,11 @@ function initialize(): void {
21
23
},
22
24
})
25
}
26
+
27
+// https://github.com/vitejs/vite/blob/27a192fc95036dbdb6e615a4201b858eb64aa075/packages/vite/src/shared/utils.ts#L48-L53
28
+function withTrailingSlash(path: string): string {
29
+ if (path[path.length - 1] !== '/') {
30
+ return `${path}/`
31
+ }
32
+ return path
33
+}
0 commit comments