@squide/firefly-webpack-configs 5.0.2 → 5.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @squide/firefly-webpack-configs
2
2
 
3
+ ## 5.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#269](https://github.com/workleap/wl-squide/pull/269) [`d3a3fa0`](https://github.com/workleap/wl-squide/commit/d3a3fa05fe75db24a128263e8a2df57233769298) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Updated dependencies.
8
+
3
9
  ## 5.0.2
4
10
 
5
11
  ### Patch Changes
@@ -20,7 +20,7 @@ import * as __WEBPACK_EXTERNAL_MODULE__shared_js_cc7b7cda__ from "./shared.js";
20
20
 
21
21
  ;// CONCATENATED MODULE: external "./shared.js"
22
22
 
23
- ;// CONCATENATED MODULE: ./src/defineConfig.ts?__rslib_entry__
23
+ ;// CONCATENATED MODULE: ./src/defineConfig.ts
24
24
 
25
25
 
26
26
 
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export * from "@workleap/webpack-configs";
2
2
  export * from "./defineConfig.js";
3
3
 
4
- ;// CONCATENATED MODULE: ./src/index.ts?__rslib_entry__
4
+ ;// CONCATENATED MODULE: ./src/index.ts
5
5
 
6
6
 
7
7
 
@@ -1,6 +1,6 @@
1
1
 
2
- ;// CONCATENATED MODULE: ./src/nonCacheableRemoteEntryPlugin.ts?__rslib_entry__
3
- const nonCacheableRemoteEntryPlugin_rslib_entry_plugin = ()=>{
2
+ ;// CONCATENATED MODULE: ./src/nonCacheableRemoteEntryPlugin.ts
3
+ const nonCacheableRemoteEntryPlugin_plugin = ()=>{
4
4
  return {
5
5
  name: "non-cacheable-remote-entry-plugin",
6
6
  createScript: function({ url }) {
@@ -14,8 +14,8 @@ const nonCacheableRemoteEntryPlugin_rslib_entry_plugin = ()=>{
14
14
  }
15
15
  };
16
16
  };
17
- /* ESM default export */ const nonCacheableRemoteEntryPlugin_rslib_entry_ = (nonCacheableRemoteEntryPlugin_rslib_entry_plugin);
17
+ /* ESM default export */ const nonCacheableRemoteEntryPlugin = (nonCacheableRemoteEntryPlugin_plugin);
18
18
 
19
- export { nonCacheableRemoteEntryPlugin_rslib_entry_ as default };
19
+ export { nonCacheableRemoteEntryPlugin as default };
20
20
 
21
21
  //# sourceMappingURL=nonCacheableRemoteEntryPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nonCacheableRemoteEntryPlugin.js","sources":["webpack://@squide/firefly-webpack-configs/./src/nonCacheableRemoteEntryPlugin.ts"],"sourcesContent":["import type { FederationRuntimePlugin } from \"@module-federation/enhanced/runtime\";\n\nconst plugin: () => FederationRuntimePlugin = () => {\n return {\n name: \"non-cacheable-remote-entry-plugin\",\n createScript: function({ url }) {\n const element = document.createElement(\"script\");\n\n // Adding a timestamp to make sure the remote entry points are never cached.\n // View: https://github.com/module-federation/module-federation-examples/issues/566.\n element.src = `${url}?t=${Date.now()}`;\n element.type = \"text/javascript\";\n element.async = true;\n\n return element;\n }\n };\n};\n\nexport default plugin;\n"],"names":["plugin","url","element","document","Date"],"mappings":";;AAEA,MAAMA,gDAAMA,GAAkC;IAC1C,OAAO;QACH,MAAM;QACN,cAAc,SAAS,EAAEC,GAAG,EAAE;YAC1B,MAAMC,UAAUC,SAAS,aAAa,CAAC;YAEvC,4EAA4E;YAC5E,oFAAoF;YACpFD,QAAQ,GAAG,GAAG,GAAGD,IAAI,GAAG,EAAEG,KAAK,GAAG,IAAI;YACtCF,QAAQ,IAAI,GAAG;YACfA,QAAQ,KAAK,GAAG;YAEhB,OAAOA;QACX;IACJ;AACJ;AAEA,6EAAeF,gDAAMA,EAAC"}
1
+ {"version":3,"file":"nonCacheableRemoteEntryPlugin.js","sources":["webpack://@squide/firefly-webpack-configs/./src/nonCacheableRemoteEntryPlugin.ts"],"sourcesContent":["import type { FederationRuntimePlugin } from \"@module-federation/enhanced/runtime\";\n\nconst plugin: () => FederationRuntimePlugin = () => {\n return {\n name: \"non-cacheable-remote-entry-plugin\",\n createScript: function({ url }) {\n const element = document.createElement(\"script\");\n\n // Adding a timestamp to make sure the remote entry points are never cached.\n // View: https://github.com/module-federation/module-federation-examples/issues/566.\n element.src = `${url}?t=${Date.now()}`;\n element.type = \"text/javascript\";\n element.async = true;\n\n return element;\n }\n };\n};\n\nexport default plugin;\n"],"names":["plugin","url","element","document","Date"],"mappings":";;AAEA,MAAMA,oCAAMA,GAAkC;IAC1C,OAAO;QACH,MAAM;QACN,cAAc,SAAS,EAAEC,GAAG,EAAE;YAC1B,MAAMC,UAAUC,SAAS,aAAa,CAAC;YAEvC,4EAA4E;YAC5E,oFAAoF;YACpFD,QAAQ,GAAG,GAAG,GAAGD,IAAI,GAAG,EAAEG,KAAK,GAAG,IAAI;YACtCF,QAAQ,IAAI,GAAG;YACfA,QAAQ,KAAK,GAAG;YAEhB,OAAOA;QACX;IACJ;AACJ;AAEA,gEAAeF,oCAAMA,EAAC"}
package/dist/shared.js CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- ;// CONCATENATED MODULE: ./src/shared.ts?__rslib_entry__
2
+ ;// CONCATENATED MODULE: ./src/shared.ts
3
3
  // Hardcoded to "host" because of the "sharedDependenciesResolutionPlugin" plugin.
4
4
  const HostApplicationName = "host";
5
5
 
@@ -5,7 +5,7 @@ import * as __WEBPACK_EXTERNAL_MODULE__shared_js_cc7b7cda__ from "./shared.js";
5
5
 
6
6
  ;// CONCATENATED MODULE: external "./shared.js"
7
7
 
8
- ;// CONCATENATED MODULE: ./src/sharedDependenciesResolutionPlugin.ts?__rslib_entry__
8
+ ;// CONCATENATED MODULE: ./src/sharedDependenciesResolutionPlugin.ts
9
9
  /*
10
10
  This custom share dependency resolution strategy ensure that only the host app can ask for a new major version of a library.
11
11
  Otherwise, any remote can request for an higher non-major version.
@@ -93,7 +93,7 @@ function resolveSharedDependency(pkgName, entries, logFct = ()=>{}) {
93
93
  highestVersionEntry: highestVersionEntry
94
94
  };
95
95
  }
96
- const sharedDependenciesResolutionPlugin_rslib_entry_plugin = ()=>{
96
+ const sharedDependenciesResolutionPlugin_plugin = ()=>{
97
97
  return {
98
98
  name: "shared-dependencies-resolution-plugin",
99
99
  resolveShare: function(args) {
@@ -130,8 +130,8 @@ const sharedDependenciesResolutionPlugin_rslib_entry_plugin = ()=>{
130
130
  }
131
131
  };
132
132
  };
133
- /* ESM default export */ const sharedDependenciesResolutionPlugin_rslib_entry_ = (sharedDependenciesResolutionPlugin_rslib_entry_plugin);
133
+ /* ESM default export */ const sharedDependenciesResolutionPlugin = (sharedDependenciesResolutionPlugin_plugin);
134
134
 
135
- export { sharedDependenciesResolutionPlugin_rslib_entry_ as default, resolveSharedDependency };
135
+ export { sharedDependenciesResolutionPlugin as default, resolveSharedDependency };
136
136
 
137
137
  //# sourceMappingURL=sharedDependenciesResolutionPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sharedDependenciesResolutionPlugin.js","sources":["webpack://@squide/firefly-webpack-configs/./src/sharedDependenciesResolutionPlugin.ts"],"sourcesContent":["/*\nThis custom share dependency resolution strategy ensure that only the host app can ask for a new major version of a library.\nOtherwise, any remote can request for an higher non-major version.\n\nExamples:\n\nhost: 2.0\nremote-1: 2.1 <-----\nremote-2: 2.0\n\nhost: 2.0 <-----\nremote-1: 3.1\nremote-2: 2.0\n\nhost: 2.0\nremote-1: 3.1\nremote-2: 2.1 <-----\n\nhost: >2.0\nremote-1: 3.1\nremote-2: 2.1 <-----\n*/\n\nimport type { FederationHost, FederationRuntimePlugin } from \"@module-federation/enhanced/runtime\";\nimport { minVersion, parse, rcompare, type SemVer } from \"semver\";\nimport { HostApplicationName } from \"./shared.ts\";\n\ntype Shared = FederationHost[\"shareScopeMap\"][string][string][string];\n\n// Toggle to \"true\" to facilitate the debugging of this plugin.\nconst isDebug = false;\n\nfunction log(...args: unknown[]) {\n if (isDebug) {\n console.log(...args);\n }\n}\n\nfunction findHighestVersionForMajor(entries: Shared[], major: number) {\n return entries.find(x => {\n return parse(x.version)!.major === major;\n }) as Shared;\n}\n\ninterface ResolveSharedDependencyResult {\n resolvedEntry: Shared;\n highestVersionEntry: Shared;\n}\n\n// The return type is required otherwise we get the following error: error TS2742: The inferred type of 'resolveSharedDependency' cannot be named without a reference to.\nexport function resolveSharedDependency(pkgName: string, entries: Shared[], logFct: (...rest: unknown[]) => void = () => {}): ResolveSharedDependencyResult {\n const cleanedEntries = entries.map(x => ({\n ...x,\n // Removing any special characters like >,>=,^,~ etc...\n version: minVersion(x.version)!.version\n }));\n\n // From higher to lower versions.\n const sortedEntries = cleanedEntries.sort((x, y) => rcompare(x.version, y.version));\n\n logFct(\"[squide] Sorted the entries by version from higher to lower\", sortedEntries);\n\n const highestVersionEntry = sortedEntries[0];\n\n logFct(`[squide] ${pkgName} highest requested version is`, highestVersionEntry.version, highestVersionEntry);\n\n // The host is always right!\n if (highestVersionEntry.from === HostApplicationName) {\n logFct(\"[squide] %cThis is the host version%c, great, resolving to:\", \"color: black; background-color: pink;\", \"\", highestVersionEntry.version, highestVersionEntry);\n\n return {\n resolvedEntry: highestVersionEntry,\n highestVersionEntry: highestVersionEntry\n };\n }\n\n logFct(`[squide] ${pkgName} Highest requested version is not from the host.`);\n\n const hostEntry = sortedEntries.find(x => x.from === HostApplicationName);\n\n // Found nothing, that's odd but let's not break the app for this.\n if (!hostEntry) {\n logFct(`[squide] The host is not requesting any version of ${pkgName}, %caborting%c.`, \"color: black; background-color: pink;\", \"\");\n\n return {\n resolvedEntry: highestVersionEntry,\n highestVersionEntry: highestVersionEntry\n };\n }\n\n logFct(`[squide] ${pkgName} version requested by the host is:`, hostEntry.version, hostEntry);\n\n const parsedHighestVersion = parse(highestVersionEntry.version) as SemVer;\n const parsedHostVersion = parse(hostEntry.version) as SemVer;\n\n // Major versions should always be introduced by the host application.\n if (parsedHighestVersion.major === parsedHostVersion.major) {\n logFct(`[squide] Resolving to %c${parsedHighestVersion.major}%c.`, \"color: black; background-color: pink;\", \"\");\n\n return {\n resolvedEntry: highestVersionEntry,\n highestVersionEntry: highestVersionEntry\n };\n }\n\n logFct(\"[squide] The major number of the highest requested version is higher than the major number of the version requested by the host, looking for another version to resolve to.\");\n\n // Start at the second entry since the first entry is the current higher version entry.\n // The result could either be the actual host entry or any other entry that is higher than the version requested\n // by the host, but match the host entry major version number.\n const fallbackEntry = findHighestVersionForMajor(sortedEntries.splice(1), parsedHostVersion.major);\n\n logFct(`[squide] The %chighest requested version%c for ${pkgName} that is in-range with the requested host major version number is:`, \"color: black; background-color: pink;\", \"\", fallbackEntry.version, fallbackEntry);\n\n return {\n resolvedEntry: fallbackEntry,\n highestVersionEntry: highestVersionEntry\n };\n}\n\nconst plugin: () => FederationRuntimePlugin = () => {\n return {\n name: \"shared-dependencies-resolution-plugin\",\n resolveShare: function(args) {\n const { shareScopeMap, scope, pkgName } = args;\n\n log(`[squide] Resolving ${pkgName}:`, args);\n\n // This custom strategy only applies to singleton shared dependencies.\n const entries = Object.values(shareScopeMap[scope][pkgName]).filter(x => {\n return (\n // Temporary check until all the remotes on Webpack Module Federation has been updated to Module Federation 2.0.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n x.singleton ||\n (x.shareConfig && x.shareConfig.singleton)\n );\n });\n\n // Not a singleton dependency.\n if (entries.length === 0) {\n log(`[squide] ${pkgName} is not a singleton dependency, aborting.`);\n\n return args;\n }\n\n // If there's only one version entry, then it means that everyone is requesting the same version\n // of the dependency.\n if (entries.length <= 1) {\n log(`[squide] There's only one version requested for ${pkgName}, resolving to:`, entries[0].version, entries[0]);\n\n return args;\n }\n\n args.resolver = () => {\n log(`[squide] There's %cmore than one requested version%c for ${pkgName}:`, \"color: black; background-color: pink;\", \"\", entries.length, shareScopeMap[scope][pkgName]);\n\n const { resolvedEntry, highestVersionEntry } = resolveSharedDependency(pkgName, entries, log);\n\n if (resolvedEntry.version !== highestVersionEntry.version) {\n // eslint-disable-next-line max-len\n console.log(`%c[squide] \"${highestVersionEntry.from}\" requested version \"${highestVersionEntry.version}\" of \"${pkgName}\". This version is higher than the major number of the version requested by the host for this dependency (${resolvedEntry.version}). The version for \"${pkgName}\" has been forced to \"${resolvedEntry.version}\".`, \"color: white; background-color: red;\");\n }\n\n return resolvedEntry;\n };\n\n return args;\n }\n };\n};\n\nexport default plugin;\n"],"names":["minVersion","parse","rcompare","HostApplicationName","isDebug","log","args","console","findHighestVersionForMajor","entries","major","x","resolveSharedDependency","pkgName","logFct","cleanedEntries","sortedEntries","y","highestVersionEntry","hostEntry","parsedHighestVersion","parsedHostVersion","fallbackEntry","plugin","shareScopeMap","scope","Object","resolvedEntry"],"mappings":";;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;AAqBA,GAGkE;AAChB;AAIlD,+DAA+D;AAC/D,MAAMI,UAAU;AAEhB,SAASC,IAAI,GAAGC,IAAe;IAC3B,IAAIF,SAAS;QACTG,QAAQ,GAAG,IAAID;IACnB;AACJ;AAEA,SAASE,2BAA2BC,OAAiB,EAAEC,KAAa;IAChE,OAAOD,QAAQ,IAAI,CAACE,CAAAA;QAChB,OAAOV,4CAAKA,CAACU,EAAE,OAAO,EAAG,KAAK,KAAKD;IACvC;AACJ;AAOA,yKAAyK;AAClK,SAASE,wBAAwBC,OAAe,EAAEJ,OAAiB,EAAEK,SAAuC,KAAO,CAAC;IACvH,MAAMC,iBAAiBN,QAAQ,GAAG,CAACE,CAAAA,IAAM;YACrC,GAAGA,CAAC;YACJ,uDAAuD;YACvD,SAASX,iDAAUA,CAACW,EAAE,OAAO,EAAG,OAAO;QAC3C;IAEA,iCAAiC;IACjC,MAAMK,gBAAgBD,eAAe,IAAI,CAAC,CAACJ,GAAGM,IAAMf,+CAAQA,CAACS,EAAE,OAAO,EAAEM,EAAE,OAAO;IAEjFH,OAAO,+DAA+DE;IAEtE,MAAME,sBAAsBF,aAAa,CAAC,EAAE;IAE5CF,OAAO,CAAC,SAAS,EAAED,QAAQ,6BA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,sBAAsB,EAAEc,cAAc,OAAO,CAAC,EAAE,CAAC,EAAE;gBAC9U;gBAEA,OAAOA;YACX;YAEA,OAAOrB;QACX;IACJ;AACJ;AAEA,kFAAeiB,qDAAMA,EAAC"}
1
+ {"version":3,"file":"sharedDependenciesResolutionPlugin.js","sources":["webpack://@squide/firefly-webpack-configs/./src/sharedDependenciesResolutionPlugin.ts"],"sourcesContent":["/*\nThis custom share dependency resolution strategy ensure that only the host app can ask for a new major version of a library.\nOtherwise, any remote can request for an higher non-major version.\n\nExamples:\n\nhost: 2.0\nremote-1: 2.1 <-----\nremote-2: 2.0\n\nhost: 2.0 <-----\nremote-1: 3.1\nremote-2: 2.0\n\nhost: 2.0\nremote-1: 3.1\nremote-2: 2.1 <-----\n\nhost: >2.0\nremote-1: 3.1\nremote-2: 2.1 <-----\n*/\n\nimport type { FederationHost, FederationRuntimePlugin } from \"@module-federation/enhanced/runtime\";\nimport { minVersion, parse, rcompare, type SemVer } from \"semver\";\nimport { HostApplicationName } from \"./shared.ts\";\n\ntype Shared = FederationHost[\"shareScopeMap\"][string][string][string];\n\n// Toggle to \"true\" to facilitate the debugging of this plugin.\nconst isDebug = false;\n\nfunction log(...args: unknown[]) {\n if (isDebug) {\n console.log(...args);\n }\n}\n\nfunction findHighestVersionForMajor(entries: Shared[], major: number) {\n return entries.find(x => {\n return parse(x.version)!.major === major;\n }) as Shared;\n}\n\ninterface ResolveSharedDependencyResult {\n resolvedEntry: Shared;\n highestVersionEntry: Shared;\n}\n\n// The return type is required otherwise we get the following error: error TS2742: The inferred type of 'resolveSharedDependency' cannot be named without a reference to.\nexport function resolveSharedDependency(pkgName: string, entries: Shared[], logFct: (...rest: unknown[]) => void = () => {}): ResolveSharedDependencyResult {\n const cleanedEntries = entries.map(x => ({\n ...x,\n // Removing any special characters like >,>=,^,~ etc...\n version: minVersion(x.version)!.version\n }));\n\n // From higher to lower versions.\n const sortedEntries = cleanedEntries.sort((x, y) => rcompare(x.version, y.version));\n\n logFct(\"[squide] Sorted the entries by version from higher to lower\", sortedEntries);\n\n const highestVersionEntry = sortedEntries[0];\n\n logFct(`[squide] ${pkgName} highest requested version is`, highestVersionEntry.version, highestVersionEntry);\n\n // The host is always right!\n if (highestVersionEntry.from === HostApplicationName) {\n logFct(\"[squide] %cThis is the host version%c, great, resolving to:\", \"color: black; background-color: pink;\", \"\", highestVersionEntry.version, highestVersionEntry);\n\n return {\n resolvedEntry: highestVersionEntry,\n highestVersionEntry: highestVersionEntry\n };\n }\n\n logFct(`[squide] ${pkgName} Highest requested version is not from the host.`);\n\n const hostEntry = sortedEntries.find(x => x.from === HostApplicationName);\n\n // Found nothing, that's odd but let's not break the app for this.\n if (!hostEntry) {\n logFct(`[squide] The host is not requesting any version of ${pkgName}, %caborting%c.`, \"color: black; background-color: pink;\", \"\");\n\n return {\n resolvedEntry: highestVersionEntry,\n highestVersionEntry: highestVersionEntry\n };\n }\n\n logFct(`[squide] ${pkgName} version requested by the host is:`, hostEntry.version, hostEntry);\n\n const parsedHighestVersion = parse(highestVersionEntry.version) as SemVer;\n const parsedHostVersion = parse(hostEntry.version) as SemVer;\n\n // Major versions should always be introduced by the host application.\n if (parsedHighestVersion.major === parsedHostVersion.major) {\n logFct(`[squide] Resolving to %c${parsedHighestVersion.major}%c.`, \"color: black; background-color: pink;\", \"\");\n\n return {\n resolvedEntry: highestVersionEntry,\n highestVersionEntry: highestVersionEntry\n };\n }\n\n logFct(\"[squide] The major number of the highest requested version is higher than the major number of the version requested by the host, looking for another version to resolve to.\");\n\n // Start at the second entry since the first entry is the current higher version entry.\n // The result could either be the actual host entry or any other entry that is higher than the version requested\n // by the host, but match the host entry major version number.\n const fallbackEntry = findHighestVersionForMajor(sortedEntries.splice(1), parsedHostVersion.major);\n\n logFct(`[squide] The %chighest requested version%c for ${pkgName} that is in-range with the requested host major version number is:`, \"color: black; background-color: pink;\", \"\", fallbackEntry.version, fallbackEntry);\n\n return {\n resolvedEntry: fallbackEntry,\n highestVersionEntry: highestVersionEntry\n };\n}\n\nconst plugin: () => FederationRuntimePlugin = () => {\n return {\n name: \"shared-dependencies-resolution-plugin\",\n resolveShare: function(args) {\n const { shareScopeMap, scope, pkgName } = args;\n\n log(`[squide] Resolving ${pkgName}:`, args);\n\n // This custom strategy only applies to singleton shared dependencies.\n const entries = Object.values(shareScopeMap[scope][pkgName]).filter(x => {\n return (\n // Temporary check until all the remotes on Webpack Module Federation has been updated to Module Federation 2.0.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n x.singleton ||\n (x.shareConfig && x.shareConfig.singleton)\n );\n });\n\n // Not a singleton dependency.\n if (entries.length === 0) {\n log(`[squide] ${pkgName} is not a singleton dependency, aborting.`);\n\n return args;\n }\n\n // If there's only one version entry, then it means that everyone is requesting the same version\n // of the dependency.\n if (entries.length <= 1) {\n log(`[squide] There's only one version requested for ${pkgName}, resolving to:`, entries[0].version, entries[0]);\n\n return args;\n }\n\n args.resolver = () => {\n log(`[squide] There's %cmore than one requested version%c for ${pkgName}:`, \"color: black; background-color: pink;\", \"\", entries.length, shareScopeMap[scope][pkgName]);\n\n const { resolvedEntry, highestVersionEntry } = resolveSharedDependency(pkgName, entries, log);\n\n if (resolvedEntry.version !== highestVersionEntry.version) {\n // eslint-disable-next-line max-len\n console.log(`%c[squide] \"${highestVersionEntry.from}\" requested version \"${highestVersionEntry.version}\" of \"${pkgName}\". This version is higher than the major number of the version requested by the host for this dependency (${resolvedEntry.version}). The version for \"${pkgName}\" has been forced to \"${resolvedEntry.version}\".`, \"color: white; background-color: red;\");\n }\n\n return resolvedEntry;\n };\n\n return args;\n }\n };\n};\n\nexport default plugin;\n"],"names":["minVersion","parse","rcompare","HostApplicationName","isDebug","log","args","console","findHighestVersionForMajor","entries","major","x","resolveSharedDependency","pkgName","logFct","cleanedEntries","sortedEntries","y","highestVersionEntry","hostEntry","parsedHighestVersion","parsedHostVersion","fallbackEntry","plugin","shareScopeMap","scope","Object","resolvedEntry"],"mappings":";;;;;;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,MAAM,KAAK,GAAG;gBACtBJ,IAAI,CAAC,SAAS,EAAEQ,QAAQ,yCAAyC,CAAC;gBAElE,OAAOP;YACX;YAEA,gGAAgG;YAChG,qBAAqB;YACrB,IAAIG,QAAQ,MAAM,IAAI,GAAG;gBACrBJ,IAAI,CAAC,gDAAgD,EAAEQ,QAAQ,eAAe,CAAC,EAAEJ,OAAO,CAAC,EAAE,CAAC,OAAO,EAAEA,OAAO,CAAC,EAAE;gBAE/G,OAAOH;YACX;YAEAA,KAAK,QAAQ,GAAG;gBACZD,IAAI,CAAC,yDAAyD,EAAEQ,QAAQ,CAAC,CAAC,EAAE,yCAAyC,IAAIJ,QAAQ,MAAM,EAAEe,aAAa,CAACC,MAAM,CAACZ,QAAQ;gBAEtK,MAAM,EAAEc,aAAa,EAAET,mBAAmB,EAAE,GAAGN,wBAAwBC,SAASJ,SAASJ;gBAEzF,IAAIsB,cAAc,OAAO,KAAKT,oBAAoB,OAAO,EAAE;oBACvD,mCAAmC;oBACnCX,QAAQ,GAAG,CAAC,CAAC,YAAY,EAAEW,oBAAoB,IAAI,CAAC,qBAAqB,EAAEA,oBAAoB,OAAO,CAAC,MAAM,EAAEL,QAAQ,0GAA0G,EAAEc,cAAc,OAAO,CAAC,oBAAoB,EAAEd,QAAQ,sBAAsB,EAAEc,cAAc,OAAO,CAAC,EAAE,CAAC,EAAE;gBAC9U;gBAEA,OAAOA;YACX;YAEA,OAAOrB;QACX;IACJ;AACJ;AAEA,qEAAeiB,yCAAMA,EAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@squide/firefly-webpack-configs",
3
3
  "author": "Workleap",
4
- "version": "5.0.2",
4
+ "version": "5.0.3",
5
5
  "description": "Webpack configuration helpers for the Squide firefly technology stack.",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
@@ -28,34 +28,34 @@
28
28
  "README.md"
29
29
  ],
30
30
  "peerDependencies": {
31
- "@swc/core": "^1.11.13",
32
- "@swc/helpers": "^0.5.15",
33
- "@workleap/swc-configs": "^2.2.5",
34
- "browserslist": "^4.24.4",
31
+ "@swc/core": "^1.11.29",
32
+ "@swc/helpers": "^0.5.17",
33
+ "@workleap/swc-configs": "^2.2.6",
34
+ "browserslist": "^4.24.5",
35
35
  "postcss": "^8.5.3",
36
- "webpack": "^5.98.0",
36
+ "webpack": "^5.99.9",
37
37
  "webpack-dev-server": "^5.2.1"
38
38
  },
39
39
  "dependencies": {
40
- "@module-federation/enhanced": "^0.11.2",
41
- "@types/node": "^22.13.14",
42
- "@types/semver": "^7.7.0",
43
- "@workleap/webpack-configs": "^1.5.4",
40
+ "@module-federation/enhanced": "0.11.4",
41
+ "@workleap/webpack-configs": "^1.5.5",
44
42
  "deepmerge": "^4.3.1",
45
43
  "html-webpack-plugin": "^5.6.3",
46
- "semver": "^7.7.1"
44
+ "semver": "^7.7.2"
47
45
  },
48
46
  "devDependencies": {
49
- "@rsbuild/core": "1.3.0",
50
- "@rslib/core": "0.6.0",
51
- "@typescript-eslint/parser": "8.28.0",
52
- "@workleap/eslint-plugin": "3.3.1",
53
- "@workleap/rslib-configs": "1.0.3",
54
- "@workleap/typescript-configs": "3.0.2",
47
+ "@rsbuild/core": "1.3.21",
48
+ "@rslib/core": "0.8.0",
49
+ "@types/node": "22.15.21",
50
+ "@types/semver": "7.7.0",
51
+ "@typescript-eslint/parser": "8.32.1",
52
+ "@workleap/eslint-plugin": "3.4.0",
53
+ "@workleap/rslib-configs": "1.0.4",
54
+ "@workleap/typescript-configs": "3.0.3",
55
55
  "eslint": "8.57.0",
56
- "typescript": "5.8.2",
57
- "vitest": "3.0.9",
58
- "webpack": "5.98.0",
56
+ "typescript": "5.8.3",
57
+ "vitest": "3.1.4",
58
+ "webpack": "5.99.9",
59
59
  "webpack-dev-server": "5.2.1"
60
60
  },
61
61
  "engines": {