@@ -19,6 +19,7 @@ import * as ld from "../core/lodash.ts";
19
19
import { ProjectType } from "./types/types.ts" ;
20
20
import { Format , Metadata , PandocFlags } from "../config/types.ts" ;
21
21
import {
22
+ FileInformation ,
22
23
kProjectLibDir ,
23
24
kProjectOutputDir ,
24
25
kProjectPostRender ,
@@ -106,6 +107,16 @@ import { createTempContext } from "../core/temp.ts";
106
107
107
108
import { onCleanup } from "../core/cleanup.ts" ;
108
109
import { once } from "../core/once.ts" ;
110
+ import { Cloneable } from "../core/safe-clone-deep.ts" ;
111
+
112
+ // Create a class that extends Map and implements Cloneable
113
+ class FileInformationCacheMap extends Map < string , FileInformation >
114
+ implements Cloneable < Map < string , FileInformation > > {
115
+ clone ( ) : Map < string , FileInformation > {
116
+ // Return the same instance (reference) instead of creating a clone
117
+ return this ;
118
+ }
119
+ }
109
120
110
121
export async function projectContext (
111
122
path : string ,
@@ -272,7 +283,7 @@ export async function projectContext(
272
283
dir : join ( dir , ".quarto" ) ,
273
284
prefix : "quarto-session-temp" ,
274
285
} ) ;
275
- const fileInformationCache = new Map ( ) ;
286
+ const fileInformationCache = new FileInformationCacheMap ( ) ;
276
287
const result : ProjectContext = {
277
288
resolveBrand : async ( fileName ?: string ) =>
278
289
projectResolveBrand ( result , fileName ) ,
@@ -368,7 +379,7 @@ export async function projectContext(
368
379
dir : join ( dir , ".quarto" ) ,
369
380
prefix : "quarto-session-temp" ,
370
381
} ) ;
371
- const fileInformationCache = new Map ( ) ;
382
+ const fileInformationCache = new FileInformationCacheMap ( ) ;
372
383
const result : ProjectContext = {
373
384
resolveBrand : async ( fileName ?: string ) =>
374
385
projectResolveBrand ( result , fileName ) ,
@@ -443,7 +454,7 @@ export async function projectContext(
443
454
dir : join ( originalDir , ".quarto" ) ,
444
455
prefix : "quarto-session-temp" ,
445
456
} ) ;
446
- const fileInformationCache = new Map ( ) ;
457
+ const fileInformationCache = new FileInformationCacheMap ( ) ;
447
458
const context : ProjectContext = {
448
459
resolveBrand : async ( fileName ?: string ) =>
449
460
projectResolveBrand ( context , fileName ) ,
0 commit comments