@@ -22,6 +22,7 @@ let container = {
2222 helpers : { } ,
2323 support : { } ,
2424 proxySupport : { } ,
25+ proxySupportConfig : { } , // Track config used to create proxySupport
2526 plugins : { } ,
2627 actor : null ,
2728 /**
@@ -67,7 +68,8 @@ class Container {
6768 container . support = { }
6869 container . helpers = await createHelpers ( config . helpers || { } )
6970 container . translation = await loadTranslation ( config . translation || null , config . vocabularies || [ ] )
70- container . proxySupport = createSupportObjects ( config . include || { } )
71+ container . proxySupportConfig = config . include || { }
72+ container . proxySupport = createSupportObjects ( container . proxySupportConfig )
7173 container . plugins = await createPlugins ( config . plugins || { } , opts )
7274 container . result = new Result ( )
7375
@@ -207,8 +209,10 @@ class Container {
207209
208210 // If new support objects are added, update the proxy support
209211 if ( newContainer . support ) {
210- const newProxySupport = createSupportObjects ( newContainer . support )
211- container . proxySupport = { ...container . proxySupport , ...newProxySupport }
212+ // Merge the new support config with existing config
213+ container . proxySupportConfig = { ...container . proxySupportConfig , ...newContainer . support }
214+ // Recreate the proxy with merged config
215+ container . proxySupport = createSupportObjects ( container . proxySupportConfig )
212216 }
213217
214218 debug ( 'appended' , JSON . stringify ( newContainer ) . slice ( 0 , 300 ) )
@@ -224,6 +228,7 @@ class Container {
224228 static async clear ( newHelpers = { } , newSupport = { } , newPlugins = { } ) {
225229 container . helpers = newHelpers
226230 container . translation = await loadTranslation ( )
231+ container . proxySupportConfig = newSupport
227232 container . proxySupport = createSupportObjects ( newSupport )
228233 container . plugins = newPlugins
229234 container . sharedKeys = new Set ( ) // Clear shared keys
0 commit comments