We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
vitest-dev
sheremet-va
antfu
patak-dev
Learn more about funding links in repositories.
Report abuse
import.meta.resolve
1 parent 915d6c4 commit cf5641aCopy full SHA for cf5641a
packages/vitest/src/runtime/external-executor.ts
@@ -71,7 +71,11 @@ export class ExternalModulesExecutor {
71
}
72
73
public resolveModule = async (specifier: string, referencer: string) => {
74
- const identifier = this.resolve(specifier, referencer)
+ let identifier = this.resolve(specifier, referencer) as string | Promise<string>
75
+
76
+ if (identifier instanceof Promise)
77
+ identifier = await identifier
78
79
return await this.createModule(identifier)
80
81
@@ -81,6 +85,8 @@ export class ExternalModulesExecutor {
85
if (id)
82
86
return id
83
87
88
89
+ // import.meta.resolve can be asynchronous in older +18 Node versions
84
90
return nativeResolve(specifier, parent)
91
92
0 commit comments