Skip to content

Commit d34f992

Browse files
author
Alain Sollberger
committed
feat(nf-runtime): added cacheTag option to bust the federation manifest file cache
- upgraded nx to the latest
1 parent 07b67c0 commit d34f992

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

libs/native-federation-runtime/src/lib/init-federation.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,13 @@ export async function initFederation(
2323
remotesOrManifestUrl: Record<string, string> | string = {},
2424
options?: InitFederationOptions
2525
): Promise<ImportMap> {
26+
const cacheOption = options?.cacheTag ? `?t=${options.cacheTag}` : '';
2627
const remotes =
2728
typeof remotesOrManifestUrl === 'string'
28-
? await loadManifest(remotesOrManifestUrl)
29+
? await loadManifest(remotesOrManifestUrl + cacheOption)
2930
: remotesOrManifestUrl;
3031

31-
const url = `./remoteEntry.json${
32-
options?.cacheTag ? `?t=${options.cacheTag}` : ''
33-
}`;
32+
const url = './remoteEntry.json' + cacheOption;
3433
const hostInfo = await loadFederationInfo(url);
3534
const hostImportMap = await processHostInfo(hostInfo);
3635
const remotesImportMap = await processRemoteInfos(remotes, {

0 commit comments

Comments
 (0)