Skip to content

Commit 89f002f

Browse files
committed
Mono environment variables
1 parent ce74cf8 commit 89f002f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Components/WebAssembly/HotReload/src/wwwroot/Microsoft.DotNet.HotReload.WebAssembly.Browser.lib.module.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
export async function onRuntimeConfigLoaded(config) {
2+
// If we have 'aspnetcore-browser-refresh', configure mono runtime for HotReload.
3+
if (config.debugLevel !== 0 && globalThis.window?.document?.querySelector("script[src*='aspnetcore-browser-refresh']")) {
4+
if (!config.environmentVariables["DOTNET_MODIFIABLE_ASSEMBLIES"]) {
5+
config.environmentVariables["DOTNET_MODIFIABLE_ASSEMBLIES"] = "debug";
6+
}
7+
if (!config.environmentVariables["__ASPNETCORE_BROWSER_TOOLS"]) {
8+
config.environmentVariables["__ASPNETCORE_BROWSER_TOOLS"] = "true";
9+
}
10+
}
11+
212
// Disable HotReload built-into the Blazor WebAssembly runtime
313
config.environmentVariables["__BLAZOR_WEBASSEMBLY_LEGACY_HOTRELOAD"] = "false";
414
}

0 commit comments

Comments
 (0)