@@ -43,6 +43,10 @@ public class JsxTransformer : IJsxTransformer
43
43
/// Hash algorithm for file-based cache
44
44
/// </summary>
45
45
private readonly IFileCacheHash _fileCacheHash ;
46
+ /// <summary>
47
+ /// Site-wide configuration
48
+ /// </summary>
49
+ private readonly IReactSiteConfiguration _config ;
46
50
47
51
/// <summary>
48
52
/// Initializes a new instance of the <see cref="JsxTransformer"/> class.
@@ -51,12 +55,14 @@ public class JsxTransformer : IJsxTransformer
51
55
/// <param name="cache">The cache to use for JSX compilation</param>
52
56
/// <param name="fileSystem">File system wrapper</param>
53
57
/// <param name="fileCacheHash">Hash algorithm for file-based cache</param>
54
- public JsxTransformer ( IReactEnvironment environment , ICache cache , IFileSystem fileSystem , IFileCacheHash fileCacheHash )
58
+ /// <param name="siteConfig">Site-wide configuration</param>
59
+ public JsxTransformer ( IReactEnvironment environment , ICache cache , IFileSystem fileSystem , IFileCacheHash fileCacheHash , IReactSiteConfiguration siteConfig )
55
60
{
56
61
_environment = environment ;
57
62
_cache = cache ;
58
63
_fileSystem = fileSystem ;
59
64
_fileCacheHash = fileCacheHash ;
65
+ _config = siteConfig ;
60
66
}
61
67
62
68
/// <summary>
@@ -135,7 +141,7 @@ public string TransformJsx(string input, bool? useHarmony = null)
135
141
var output = _environment . ExecuteWithLargerStackIfRequired < string > (
136
142
"ReactNET_transform" ,
137
143
input ,
138
- useHarmony . HasValue ? useHarmony . Value : _environment . SiteConfiguration . UseHarmony
144
+ useHarmony . HasValue ? useHarmony . Value : _config . UseHarmony
139
145
) ;
140
146
return output ;
141
147
}
0 commit comments