@@ -27,10 +27,6 @@ import {
27
27
} from './ssrTransform'
28
28
import { ssrFixStacktrace } from './ssrStacktrace'
29
29
30
- interface SSRContext {
31
- global : typeof globalThis
32
- }
33
-
34
30
type SSRModule = Record < string , any >
35
31
36
32
interface NodeImportResolveOptions
@@ -45,7 +41,6 @@ const importErrors = new WeakMap<Error, { importee: string }>()
45
41
export async function ssrLoadModule (
46
42
url : string ,
47
43
server : ViteDevServer ,
48
- context : SSRContext = { global } ,
49
44
fixStacktrace ?: boolean ,
50
45
) : Promise < SSRModule > {
51
46
url = unwrapId ( url )
@@ -59,7 +54,7 @@ export async function ssrLoadModule(
59
54
return pending
60
55
}
61
56
62
- const modulePromise = instantiateModule ( url , server , context , fixStacktrace )
57
+ const modulePromise = instantiateModule ( url , server , fixStacktrace )
63
58
pendingModules . set ( url , modulePromise )
64
59
modulePromise
65
60
. catch ( ( ) => {
@@ -74,7 +69,6 @@ export async function ssrLoadModule(
74
69
async function instantiateModule (
75
70
url : string ,
76
71
server : ViteDevServer ,
77
- context : SSRContext = { global } ,
78
72
fixStacktrace ?: boolean ,
79
73
) : Promise < SSRModule > {
80
74
const { moduleGraph } = server
@@ -169,7 +163,7 @@ async function instantiateModule(
169
163
}
170
164
}
171
165
172
- return ssrLoadModule ( dep , server , context , fixStacktrace )
166
+ return ssrLoadModule ( dep , server , fixStacktrace )
173
167
} catch ( err ) {
174
168
// tell external error handler which mod was imported with error
175
169
importErrors . set ( err , { importee : dep } )
@@ -213,7 +207,6 @@ async function instantiateModule(
213
207
214
208
try {
215
209
const initModule = new AsyncFunction (
216
- `global` ,
217
210
ssrModuleExportsKey ,
218
211
ssrImportMetaKey ,
219
212
ssrImportKey ,
@@ -224,7 +217,6 @@ async function instantiateModule(
224
217
`\n//# sourceURL=${ mod . id } ${ sourceMapSuffix } ` ,
225
218
)
226
219
await initModule (
227
- context . global ,
228
220
ssrModule ,
229
221
ssrImportMeta ,
230
222
ssrImport ,
0 commit comments