@@ -19,6 +19,7 @@ import * as ld from "../core/lodash.ts";
1919import { ProjectType } from "./types/types.ts" ;
2020import { Format , Metadata , PandocFlags } from "../config/types.ts" ;
2121import {
22+ FileInformation ,
2223 kProjectLibDir ,
2324 kProjectOutputDir ,
2425 kProjectPostRender ,
@@ -106,6 +107,16 @@ import { createTempContext } from "../core/temp.ts";
106107
107108import { onCleanup } from "../core/cleanup.ts" ;
108109import { 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+ }
109120
110121export async function projectContext (
111122 path : string ,
@@ -272,7 +283,7 @@ export async function projectContext(
272283 dir : join ( dir , ".quarto" ) ,
273284 prefix : "quarto-session-temp" ,
274285 } ) ;
275- const fileInformationCache = new Map ( ) ;
286+ const fileInformationCache = new FileInformationCacheMap ( ) ;
276287 const result : ProjectContext = {
277288 resolveBrand : async ( fileName ?: string ) =>
278289 projectResolveBrand ( result , fileName ) ,
@@ -368,7 +379,7 @@ export async function projectContext(
368379 dir : join ( dir , ".quarto" ) ,
369380 prefix : "quarto-session-temp" ,
370381 } ) ;
371- const fileInformationCache = new Map ( ) ;
382+ const fileInformationCache = new FileInformationCacheMap ( ) ;
372383 const result : ProjectContext = {
373384 resolveBrand : async ( fileName ?: string ) =>
374385 projectResolveBrand ( result , fileName ) ,
@@ -443,7 +454,7 @@ export async function projectContext(
443454 dir : join ( originalDir , ".quarto" ) ,
444455 prefix : "quarto-session-temp" ,
445456 } ) ;
446- const fileInformationCache = new Map ( ) ;
457+ const fileInformationCache = new FileInformationCacheMap ( ) ;
447458 const context : ProjectContext = {
448459 resolveBrand : async ( fileName ?: string ) =>
449460 projectResolveBrand ( context , fileName ) ,
0 commit comments