Skip to content

Commit e1b2e08

Browse files
authored
fix: externalize before caching (#9077)
1 parent 229b5b3 commit e1b2e08

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

‎packages/vitest/src/node/cache/fsModuleCache.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class FileSystemModuleCache{
3434
privaterootCache: string
3535
privatemetadataFilePath: string
3636

37-
privateversion='1.0.0-beta.1'
37+
privateversion='1.0.0-beta.2'
3838
privatefsCacheRoots=newWeakMap<ResolvedConfig,string>()
3939
privatefsEnvironmentHashMap=newWeakMap<DevEnvironment,string>()
4040
privatefsCacheKeyGenerators=newSet<CacheKeyIdGenerator>()

‎packages/vitest/src/node/environments/fetchModule.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ class ModuleFetcher{
6666
return{cache: true}
6767
}
6868

69+
constexternalize=awaitthis.resolver.shouldExternalize(moduleGraphModule.id!)
70+
if(externalize){
71+
return{ externalize,type: 'module'}
72+
}
73+
6974
constcachePath=awaitthis.getCachePath(
7075
environment,
7176
moduleGraphModule,
@@ -271,11 +276,6 @@ class ModuleFetcher{
271276
moduleGraphModule: EnvironmentModuleNode,
272277
options?: FetchFunctionOptions,
273278
): Promise<FetchResult>{
274-
constexternalize=awaitthis.resolver.shouldExternalize(moduleGraphModule.id!)
275-
if(externalize){
276-
return{ externalize,type: 'module'}
277-
}
278-
279279
constmoduleRunnerModule=awaitfetchModule(
280280
environment,
281281
url,

0 commit comments

Comments
(0)