Skip to content

Commit 69bee3a

Browse files
Copilotjaviercn
andcommitted
Add cache busting query string to dotnet.js import statements
Co-authored-by: javiercn <[email protected]>
1 parent 9dbe254 commit 69bee3a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ async function importDotnetJs(startOptions: Partial<WebAssemblyStartOptions>): P
120120
// Allow overriding the URI from which the dotnet.*.js file is loaded
121121
if (startOptions.loadBootResource) {
122122
const resourceType: WebAssemblyBootResourceType = 'dotnetjs';
123-
const customSrc = startOptions.loadBootResource(resourceType, 'dotnet.js', '_framework/dotnet.js', '', 'js-module-dotnet');
123+
const customSrc = startOptions.loadBootResource(resourceType, 'dotnet.js', `_framework/dotnet.js?v=${Date.now()}`, '', 'js-module-dotnet');
124124
if (typeof (customSrc) === 'string') {
125125
const absoluteSrc = (new URL(customSrc, document.baseURI)).toString();
126126
return await import(/* webpackIgnore: true */ absoluteSrc);
@@ -131,7 +131,7 @@ async function importDotnetJs(startOptions: Partial<WebAssemblyStartOptions>): P
131131
}
132132

133133
// @ts-ignore: This dynamic import is handled at runtime and does not need a type declaration.
134-
return await import(/* webpackIgnore: true */ "./dotnet.js");
134+
return await import(/* webpackIgnore: true */ `./dotnet.js?v=${Date.now()}`);
135135
}
136136

137137
function prepareRuntimeConfig(options: Partial<WebAssemblyStartOptions>, onConfigLoadedCallback?: (loadedConfig: MonoConfig) => void): DotnetModuleConfig {

0 commit comments

Comments
 (0)