@module-federation/node 2.7.32 → 2.7.33

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.
Files changed (122) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +31 -0
  2. package/dist/_virtual/_rolldown/runtime.mjs +8 -0
  3. package/dist/plugins/ChunkCorrelationPlugin.js +308 -0
  4. package/dist/plugins/ChunkCorrelationPlugin.js.map +1 -0
  5. package/dist/plugins/ChunkCorrelationPlugin.mjs +305 -0
  6. package/dist/plugins/ChunkCorrelationPlugin.mjs.map +1 -0
  7. package/dist/src/filesystem/stratagies.d.mts +21 -0
  8. package/dist/src/filesystem/stratagies.d.ts +10 -7
  9. package/dist/src/filesystem/stratagies.js +97 -116
  10. package/dist/src/filesystem/stratagies.js.map +1 -1
  11. package/dist/src/filesystem/stratagies.mjs +103 -0
  12. package/dist/src/filesystem/stratagies.mjs.map +1 -0
  13. package/dist/src/index.d.mts +8 -0
  14. package/dist/src/index.d.ts +8 -7
  15. package/dist/src/index.js +16 -22
  16. package/dist/src/index.mjs +9 -0
  17. package/dist/src/plugins/AutomaticPublicPathPlugin.d.mts +12 -0
  18. package/dist/src/plugins/AutomaticPublicPathPlugin.d.ts +9 -7
  19. package/dist/src/plugins/AutomaticPublicPathPlugin.js +26 -35
  20. package/dist/src/plugins/AutomaticPublicPathPlugin.js.map +1 -1
  21. package/dist/src/plugins/AutomaticPublicPathPlugin.mjs +28 -0
  22. package/dist/src/plugins/AutomaticPublicPathPlugin.mjs.map +1 -0
  23. package/dist/src/plugins/ChunkCorrelationPlugin.d.mts +5 -0
  24. package/dist/src/plugins/ChunkCorrelationPlugin.d.ts +4 -61
  25. package/dist/src/plugins/ChunkCorrelationPlugin.js +8 -440
  26. package/dist/src/plugins/ChunkCorrelationPlugin.js.map +1 -1
  27. package/dist/src/plugins/ChunkCorrelationPlugin.mjs +8 -0
  28. package/dist/src/plugins/ChunkCorrelationPlugin.mjs.map +1 -0
  29. package/dist/src/plugins/CommonJsChunkLoadingPlugin.d.mts +21 -0
  30. package/dist/src/plugins/CommonJsChunkLoadingPlugin.d.ts +16 -13
  31. package/dist/src/plugins/CommonJsChunkLoadingPlugin.js +68 -118
  32. package/dist/src/plugins/CommonJsChunkLoadingPlugin.js.map +1 -1
  33. package/dist/src/plugins/CommonJsChunkLoadingPlugin.mjs +70 -0
  34. package/dist/src/plugins/CommonJsChunkLoadingPlugin.mjs.map +1 -0
  35. package/dist/src/plugins/DynamicFilesystemChunkLoadingRuntimeModule.d.mts +46 -0
  36. package/dist/src/plugins/DynamicFilesystemChunkLoadingRuntimeModule.d.ts +39 -34
  37. package/dist/src/plugins/DynamicFilesystemChunkLoadingRuntimeModule.js +110 -126
  38. package/dist/src/plugins/DynamicFilesystemChunkLoadingRuntimeModule.js.map +1 -1
  39. package/dist/src/plugins/DynamicFilesystemChunkLoadingRuntimeModule.mjs +111 -0
  40. package/dist/src/plugins/DynamicFilesystemChunkLoadingRuntimeModule.mjs.map +1 -0
  41. package/dist/src/plugins/EntryChunkTrackerPlugin.d.mts +17 -0
  42. package/dist/src/plugins/EntryChunkTrackerPlugin.d.ts +14 -10
  43. package/dist/src/plugins/EntryChunkTrackerPlugin.js +30 -32
  44. package/dist/src/plugins/EntryChunkTrackerPlugin.js.map +1 -1
  45. package/dist/src/plugins/EntryChunkTrackerPlugin.mjs +38 -0
  46. package/dist/src/plugins/EntryChunkTrackerPlugin.mjs.map +1 -0
  47. package/dist/src/plugins/NodeFederationPlugin.d.mts +54 -0
  48. package/dist/src/plugins/NodeFederationPlugin.d.ts +33 -26
  49. package/dist/src/plugins/NodeFederationPlugin.js +69 -84
  50. package/dist/src/plugins/NodeFederationPlugin.js.map +1 -1
  51. package/dist/src/plugins/NodeFederationPlugin.mjs +70 -0
  52. package/dist/src/plugins/NodeFederationPlugin.mjs.map +1 -0
  53. package/dist/src/plugins/RemotePublicPathRuntimeModule.d.mts +15 -0
  54. package/dist/src/plugins/RemotePublicPathRuntimeModule.d.ts +12 -8
  55. package/dist/src/plugins/RemotePublicPathRuntimeModule.js +34 -35
  56. package/dist/src/plugins/RemotePublicPathRuntimeModule.js.map +1 -1
  57. package/dist/src/plugins/RemotePublicPathRuntimeModule.mjs +132 -0
  58. package/dist/src/plugins/RemotePublicPathRuntimeModule.mjs.map +1 -0
  59. package/dist/src/plugins/StreamingTargetPlugin.d.mts +32 -0
  60. package/dist/src/plugins/StreamingTargetPlugin.d.ts +19 -16
  61. package/dist/src/plugins/StreamingTargetPlugin.js +43 -56
  62. package/dist/src/plugins/StreamingTargetPlugin.js.map +1 -1
  63. package/dist/src/plugins/StreamingTargetPlugin.mjs +46 -0
  64. package/dist/src/plugins/StreamingTargetPlugin.mjs.map +1 -0
  65. package/dist/src/plugins/UniversalFederationPlugin.d.mts +49 -0
  66. package/dist/src/plugins/UniversalFederationPlugin.d.ts +26 -23
  67. package/dist/src/plugins/UniversalFederationPlugin.js +58 -81
  68. package/dist/src/plugins/UniversalFederationPlugin.js.map +1 -1
  69. package/dist/src/plugins/UniversalFederationPlugin.mjs +61 -0
  70. package/dist/src/plugins/UniversalFederationPlugin.mjs.map +1 -0
  71. package/dist/src/plugins/UniverseEntryChunkTrackerPlugin.d.mts +9 -0
  72. package/dist/src/plugins/UniverseEntryChunkTrackerPlugin.d.ts +6 -3
  73. package/dist/src/plugins/UniverseEntryChunkTrackerPlugin.js +17 -17
  74. package/dist/src/plugins/UniverseEntryChunkTrackerPlugin.js.map +1 -1
  75. package/dist/src/plugins/UniverseEntryChunkTrackerPlugin.mjs +25 -0
  76. package/dist/src/plugins/UniverseEntryChunkTrackerPlugin.mjs.map +1 -0
  77. package/dist/src/plugins/webpackChunkUtilities.d.mts +55 -0
  78. package/dist/src/plugins/webpackChunkUtilities.d.ts +14 -9
  79. package/dist/src/plugins/webpackChunkUtilities.js +195 -257
  80. package/dist/src/plugins/webpackChunkUtilities.js.map +1 -1
  81. package/dist/src/plugins/webpackChunkUtilities.mjs +234 -0
  82. package/dist/src/plugins/webpackChunkUtilities.mjs.map +1 -0
  83. package/dist/src/recordDynamicRemoteEntryHashPlugin.d.mts +7 -0
  84. package/dist/src/recordDynamicRemoteEntryHashPlugin.d.ts +5 -2
  85. package/dist/src/recordDynamicRemoteEntryHashPlugin.js +24 -61
  86. package/dist/src/recordDynamicRemoteEntryHashPlugin.js.map +1 -1
  87. package/dist/src/recordDynamicRemoteEntryHashPlugin.mjs +26 -0
  88. package/dist/src/recordDynamicRemoteEntryHashPlugin.mjs.map +1 -0
  89. package/dist/src/runtimePlugin.d.mts +27 -0
  90. package/dist/src/runtimePlugin.d.ts +24 -19
  91. package/dist/src/runtimePlugin.js +157 -252
  92. package/dist/src/runtimePlugin.js.map +1 -1
  93. package/dist/src/runtimePlugin.mjs +169 -0
  94. package/dist/src/runtimePlugin.mjs.map +1 -0
  95. package/dist/src/types/index.d.mts +8 -0
  96. package/dist/src/types/index.d.ts +8 -3
  97. package/dist/src/types/index.js +1 -3
  98. package/dist/src/types/index.mjs +1 -0
  99. package/dist/src/utils/flush-chunks.d.mts +15 -0
  100. package/dist/src/utils/flush-chunks.d.ts +7 -3
  101. package/dist/src/utils/flush-chunks.js +87 -161
  102. package/dist/src/utils/flush-chunks.js.map +1 -1
  103. package/dist/src/utils/flush-chunks.mjs +99 -0
  104. package/dist/src/utils/flush-chunks.mjs.map +1 -0
  105. package/dist/src/utils/hot-reload.d.mts +16 -0
  106. package/dist/src/utils/hot-reload.d.ts +14 -10
  107. package/dist/src/utils/hot-reload.js +177 -264
  108. package/dist/src/utils/hot-reload.js.map +1 -1
  109. package/dist/src/utils/hot-reload.mjs +194 -0
  110. package/dist/src/utils/hot-reload.mjs.map +1 -0
  111. package/dist/src/utils/index.d.mts +3 -0
  112. package/dist/src/utils/index.d.ts +3 -2
  113. package/dist/src/utils/index.js +15 -19
  114. package/dist/src/utils/index.mjs +4 -0
  115. package/package.json +59 -15
  116. package/dist/jest.config.d.ts +0 -11
  117. package/dist/jest.config.js +0 -19
  118. package/dist/jest.config.js.map +0 -1
  119. package/dist/package.json +0 -82
  120. package/dist/src/index.js.map +0 -1
  121. package/dist/src/types/index.js.map +0 -1
  122. package/dist/src/utils/index.js.map +0 -1
@@ -0,0 +1,132 @@
1
+ import { __require } from "../../_virtual/_rolldown/runtime.mjs";
2
+ import { normalizeWebpackPath } from "@module-federation/sdk/normalize-webpack-path";
3
+
4
+ //#region src/plugins/RemotePublicPathRuntimeModule.ts
5
+ const { RuntimeGlobals, RuntimeModule, Template, javascript } = __require(normalizeWebpackPath("webpack"));
6
+ const { getUndoPath } = __require(normalizeWebpackPath("webpack/lib/util/identifier"));
7
+ var AutoPublicPathRuntimeModule = class extends RuntimeModule {
8
+ constructor(options) {
9
+ super("publicPath", RuntimeModule.STAGE_BASIC + 1);
10
+ this.options = options;
11
+ }
12
+ /**
13
+ * @returns {string} runtime code
14
+ */
15
+ generate() {
16
+ const { compilation } = this;
17
+ const { scriptType, path, publicPath, importMetaName, uniqueName, chunkLoading } = compilation.outputOptions;
18
+ const getPath = () => compilation?.getPath(publicPath || "", { hash: compilation?.hash || "XXXX" });
19
+ const currentChunk = this.chunk;
20
+ const chunkName = currentChunk && compilation?.getPath(javascript.JavascriptModulesPlugin.getChunkFilenameTemplate(currentChunk, compilation?.outputOptions), {
21
+ chunk: currentChunk,
22
+ contentHashType: "javascript"
23
+ });
24
+ let undoPath = null;
25
+ if (chunkName && path) undoPath = getUndoPath(chunkName, path, false);
26
+ const getPathFromFederation = `
27
+ function getPathFromFederation() {
28
+ // Access the global federation manager or create a fallback object
29
+ var federationManager = globalThis.__FEDERATION__ || {};
30
+ // Access the current Webpack instance's federation details or create a fallback object
31
+ var instance = __webpack_require__.federation.instance || {};
32
+
33
+ // Function to aggregate all known remote module paths
34
+ var getAllKnownRemotes = function() {
35
+ var found = {};
36
+ // Iterate over all federation instances to collect module cache entries
37
+ (federationManager.__INSTANCES__ || []).forEach((instance) => {
38
+ if(instance){
39
+ instance.moduleCache.forEach((value, key) => {
40
+ found[key] = value;
41
+ });
42
+ }
43
+ });
44
+ return found;
45
+ };
46
+
47
+ // Retrieve the combined remote cache from all federation instances
48
+ const combinedRemoteCache = getAllKnownRemotes();
49
+ // Get the name of the current host from the instance
50
+ const hostName = instance.name;
51
+ // Find the path for the current host in the remote cache
52
+ const foundPath = combinedRemoteCache[hostName];
53
+ // If a path is not found, return undefined to indicate the absence of an entry path
54
+ if (!foundPath) { return undefined; }
55
+ // Return the entry path for the found remote module
56
+ const entryPath = foundPath.remoteInfo.entry;
57
+ return entryPath;
58
+ }
59
+ `;
60
+ const definePropertyCode = `
61
+ Object.defineProperty(__webpack_require__, "p", {
62
+ get: function() {
63
+ var scriptUrl;
64
+
65
+ // Attempt to get the script URL based on the environment
66
+ var scriptType = ${JSON.stringify(scriptType)};
67
+ var chunkLoading = ${JSON.stringify(chunkLoading)};
68
+ var isModuleEnvironment = ['module', 'node', 'async-node', 'require'].includes(scriptType) || chunkLoading;
69
+
70
+ if (isModuleEnvironment) {
71
+ try {
72
+ // Use Function constructor to avoid direct reference to import.meta in environments that do not support it
73
+ scriptUrl = (new Function('return typeof ${importMetaName}.url === "string" ? ${importMetaName}.url : undefined;'))();
74
+ } catch (e) {
75
+ // Handle cases where import.meta is not available or other errors occur
76
+ var scriptPath = getPathFromFederation();
77
+ if (scriptPath) {
78
+ scriptUrl = scriptPath;
79
+ } else if (typeof __filename !== "undefined") {
80
+ scriptUrl = __filename;
81
+ } else {
82
+ scriptUrl = ${publicPath !== "auto" ? JSON.stringify(getPath()) : "undefined"};
83
+ }
84
+ }
85
+ } else {
86
+ // Fallback for non-module environments, such as browsers
87
+ if (${RuntimeGlobals.global}.importScripts) {
88
+ scriptUrl = ${RuntimeGlobals.global}.location + "";
89
+ }
90
+ var document = ${RuntimeGlobals.global}.document;
91
+ if (!scriptUrl && document) {
92
+ if (document.currentScript) {
93
+ scriptUrl = document.currentScript.src;
94
+ } else {
95
+ var scripts = document.getElementsByTagName("script");
96
+ if (scripts.length) {
97
+ scriptUrl = scripts[scripts.length - 1].src;
98
+ }
99
+ }
100
+ }
101
+ }
102
+
103
+ if (!scriptUrl) {
104
+ throw new Error("Unable to calculate automatic public path");
105
+ }
106
+
107
+ // Clean up the script URL by removing any hash or query parameters
108
+ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\\?.*$/, "").replace(/\\/[^\\/]+$/, "/");
109
+
110
+ // Apply any undo path that might be necessary for nested public paths
111
+ var finalScript = ${JSON.stringify(undoPath)} ? scriptUrl + ${JSON.stringify(undoPath)} : scriptUrl;
112
+
113
+ // Helper function to ensure the URL has a protocol if it starts with '//'
114
+ var addProtocol = function(url) {
115
+ return url.startsWith('//') ? 'https:' + url : url;
116
+ };
117
+
118
+ // Set the global variable for the public path
119
+ globalThis.currentVmokPublicPath = addProtocol(finalScript) || '/';
120
+
121
+ // Return the final public path
122
+ return finalScript
123
+ }
124
+ });
125
+ `;
126
+ return Template.asString([getPathFromFederation, definePropertyCode]);
127
+ }
128
+ };
129
+
130
+ //#endregion
131
+ export { AutoPublicPathRuntimeModule as default };
132
+ //# sourceMappingURL=RemotePublicPathRuntimeModule.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RemotePublicPathRuntimeModule.mjs","names":[],"sources":["../../../src/plugins/RemotePublicPathRuntimeModule.ts"],"sourcesContent":["import { normalizeWebpackPath } from '@module-federation/sdk/normalize-webpack-path';\nconst { RuntimeGlobals, RuntimeModule, Template, javascript } = require(\n normalizeWebpackPath('webpack'),\n) as typeof import('webpack');\nconst { getUndoPath } = require(\n normalizeWebpackPath('webpack/lib/util/identifier'),\n) as typeof import('webpack/lib/util/identifier');\n\nclass AutoPublicPathRuntimeModule extends RuntimeModule {\n private options: any;\n\n constructor(options: any) {\n super('publicPath', RuntimeModule.STAGE_BASIC + 1);\n this.options = options;\n }\n\n /**\n * @returns {string} runtime code\n */\n override generate() {\n const { compilation } = this;\n const {\n scriptType,\n path,\n publicPath,\n importMetaName,\n uniqueName,\n chunkLoading,\n //@ts-ignore\n } = compilation.outputOptions;\n\n const getPath = () =>\n compilation?.getPath(publicPath || '', {\n hash: compilation?.hash || 'XXXX',\n });\n\n const currentChunk = this.chunk;\n const chunkName =\n currentChunk &&\n compilation?.getPath(\n javascript.JavascriptModulesPlugin.getChunkFilenameTemplate(\n currentChunk,\n compilation?.outputOptions,\n ),\n {\n chunk: currentChunk,\n contentHashType: 'javascript',\n },\n );\n\n let undoPath: string | null = null;\n if (chunkName && path) {\n undoPath = getUndoPath(chunkName, path, false);\n }\n\n const getPathFromFederation = `\nfunction getPathFromFederation() {\n // Access the global federation manager or create a fallback object\n var federationManager = globalThis.__FEDERATION__ || {};\n // Access the current Webpack instance's federation details or create a fallback object\n var instance = __webpack_require__.federation.instance || {};\n\n // Function to aggregate all known remote module paths\n var getAllKnownRemotes = function() {\n var found = {};\n // Iterate over all federation instances to collect module cache entries\n (federationManager.__INSTANCES__ || []).forEach((instance) => {\n if(instance){\n instance.moduleCache.forEach((value, key) => {\n found[key] = value;\n });\n }\n });\n return found;\n };\n\n // Retrieve the combined remote cache from all federation instances\n const combinedRemoteCache = getAllKnownRemotes();\n // Get the name of the current host from the instance\n const hostName = instance.name;\n // Find the path for the current host in the remote cache\n const foundPath = combinedRemoteCache[hostName];\n // If a path is not found, return undefined to indicate the absence of an entry path\n if (!foundPath) { return undefined; }\n // Return the entry path for the found remote module\n const entryPath = foundPath.remoteInfo.entry;\n return entryPath;\n}\n`;\n const definePropertyCode = `\nObject.defineProperty(__webpack_require__, \"p\", {\n get: function() {\n var scriptUrl;\n\n // Attempt to get the script URL based on the environment\n var scriptType = ${JSON.stringify(scriptType)};\n var chunkLoading = ${JSON.stringify(chunkLoading)};\n var isModuleEnvironment = ['module', 'node', 'async-node', 'require'].includes(scriptType) || chunkLoading;\n\n if (isModuleEnvironment) {\n try {\n // Use Function constructor to avoid direct reference to import.meta in environments that do not support it\n scriptUrl = (new Function('return typeof ${importMetaName}.url === \"string\" ? ${importMetaName}.url : undefined;'))();\n } catch (e) {\n // Handle cases where import.meta is not available or other errors occur\n var scriptPath = getPathFromFederation();\n if (scriptPath) {\n scriptUrl = scriptPath;\n } else if (typeof __filename !== \"undefined\") {\n scriptUrl = __filename;\n } else {\n scriptUrl = ${\n publicPath !== 'auto' ? JSON.stringify(getPath()) : 'undefined'\n };\n }\n }\n } else {\n // Fallback for non-module environments, such as browsers\n if (${RuntimeGlobals.global}.importScripts) {\n scriptUrl = ${RuntimeGlobals.global}.location + \"\";\n }\n var document = ${RuntimeGlobals.global}.document;\n if (!scriptUrl && document) {\n if (document.currentScript) {\n scriptUrl = document.currentScript.src;\n } else {\n var scripts = document.getElementsByTagName(\"script\");\n if (scripts.length) {\n scriptUrl = scripts[scripts.length - 1].src;\n }\n }\n }\n }\n\n if (!scriptUrl) {\n throw new Error(\"Unable to calculate automatic public path\");\n }\n\n // Clean up the script URL by removing any hash or query parameters\n scriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\\\?.*$/, \"\").replace(/\\\\/[^\\\\/]+$/, \"/\");\n\n // Apply any undo path that might be necessary for nested public paths\n var finalScript = ${JSON.stringify(\n undoPath,\n )} ? scriptUrl + ${JSON.stringify(undoPath)} : scriptUrl;\n\n // Helper function to ensure the URL has a protocol if it starts with '//'\n var addProtocol = function(url) {\n return url.startsWith('//') ? 'https:' + url : url;\n };\n\n // Set the global variable for the public path\n globalThis.currentVmokPublicPath = addProtocol(finalScript) || '/';\n\n // Return the final public path\n return finalScript\n }\n});\n`;\n\n return Template.asString([getPathFromFederation, definePropertyCode]);\n }\n}\n\nexport default AutoPublicPathRuntimeModule;\n"],"mappings":";;;;AACA,MAAM,EAAE,gBAAgB,eAAe,UAAU,yBAC/C,qBAAqB,UAAU,CAChC;AACD,MAAM,EAAE,0BACN,qBAAqB,8BAA8B,CACpD;AAED,IAAM,8BAAN,cAA0C,cAAc;CAGtD,YAAY,SAAc;AACxB,QAAM,cAAc,cAAc,cAAc,EAAE;AAClD,OAAK,UAAU;;;;;CAMjB,AAAS,WAAW;EAClB,MAAM,EAAE,gBAAgB;EACxB,MAAM,EACJ,YACA,MACA,YACA,gBACA,YACA,iBAEE,YAAY;EAEhB,MAAM,gBACJ,aAAa,QAAQ,cAAc,IAAI,EACrC,MAAM,aAAa,QAAQ,QAC5B,CAAC;EAEJ,MAAM,eAAe,KAAK;EAC1B,MAAM,YACJ,gBACA,aAAa,QACX,WAAW,wBAAwB,yBACjC,cACA,aAAa,cACd,EACD;GACE,OAAO;GACP,iBAAiB;GAClB,CACF;EAEH,IAAI,WAA0B;AAC9B,MAAI,aAAa,KACf,YAAW,YAAY,WAAW,MAAM,MAAM;EAGhD,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkC9B,MAAM,qBAAqB;;;;;;uBAMR,KAAK,UAAU,WAAW,CAAC;yBACzB,KAAK,UAAU,aAAa,CAAC;;;;;;mDAMH,eAAe,sBAAsB,eAAe;;;;;;;;;wBAU3F,eAAe,SAAS,KAAK,UAAU,SAAS,CAAC,GAAG,YACrD;;;;;YAKC,eAAe,OAAO;sBACZ,eAAe,OAAO;;uBAErB,eAAe,OAAO;;;;;;;;;;;;;;;;;;;;;wBAqBrB,KAAK,UACvB,SACD,CAAC,iBAAiB,KAAK,UAAU,SAAS,CAAC;;;;;;;;;;;;;;;AAgB5C,SAAO,SAAS,SAAS,CAAC,uBAAuB,mBAAmB,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { ModuleFederationPluginOptions } from "../types/index.mjs";
2
+ import { Compiler, WebpackPluginInstance } from "webpack";
3
+
4
+ //#region src/plugins/StreamingTargetPlugin.d.ts
5
+ /**
6
+ * Interface for StreamingTargetOptions which extends ModuleFederationPluginOptions
7
+ * @property {string} promiseBaseURI - The base URI for the promise
8
+ * @property {boolean} debug - Flag to enable/disable debug mode
9
+ */
10
+ interface StreamingTargetOptions extends ModuleFederationPluginOptions {
11
+ promiseBaseURI?: string;
12
+ debug?: boolean;
13
+ }
14
+ /**
15
+ * Class representing a StreamingTargetPlugin
16
+ */
17
+ declare class StreamingTargetPlugin implements WebpackPluginInstance {
18
+ private options;
19
+ /**
20
+ * Create a StreamingTargetPlugin
21
+ * @param {StreamingTargetOptions} options - The options for the plugin
22
+ */
23
+ constructor(options: StreamingTargetOptions);
24
+ /**
25
+ * Apply the plugin to the compiler
26
+ * @param {Compiler} compiler - The webpack compiler
27
+ */
28
+ apply(compiler: Compiler): void;
29
+ }
30
+ //#endregion
31
+ export { StreamingTargetPlugin as default };
32
+ //# sourceMappingURL=StreamingTargetPlugin.d.mts.map
@@ -1,28 +1,31 @@
1
- import type { Compiler, WebpackPluginInstance } from 'webpack';
2
- import type { ModuleFederationPluginOptions } from '../types';
1
+ import { ModuleFederationPluginOptions } from "../types/index.js";
2
+ import { Compiler, WebpackPluginInstance } from "webpack";
3
+
4
+ //#region src/plugins/StreamingTargetPlugin.d.ts
3
5
  /**
4
6
  * Interface for StreamingTargetOptions which extends ModuleFederationPluginOptions
5
7
  * @property {string} promiseBaseURI - The base URI for the promise
6
8
  * @property {boolean} debug - Flag to enable/disable debug mode
7
9
  */
8
10
  interface StreamingTargetOptions extends ModuleFederationPluginOptions {
9
- promiseBaseURI?: string;
10
- debug?: boolean;
11
+ promiseBaseURI?: string;
12
+ debug?: boolean;
11
13
  }
12
14
  /**
13
15
  * Class representing a StreamingTargetPlugin
14
16
  */
15
17
  declare class StreamingTargetPlugin implements WebpackPluginInstance {
16
- private options;
17
- /**
18
- * Create a StreamingTargetPlugin
19
- * @param {StreamingTargetOptions} options - The options for the plugin
20
- */
21
- constructor(options: StreamingTargetOptions);
22
- /**
23
- * Apply the plugin to the compiler
24
- * @param {Compiler} compiler - The webpack compiler
25
- */
26
- apply(compiler: Compiler): void;
18
+ private options;
19
+ /**
20
+ * Create a StreamingTargetPlugin
21
+ * @param {StreamingTargetOptions} options - The options for the plugin
22
+ */
23
+ constructor(options: StreamingTargetOptions);
24
+ /**
25
+ * Apply the plugin to the compiler
26
+ * @param {Compiler} compiler - The webpack compiler
27
+ */
28
+ apply(compiler: Compiler): void;
27
29
  }
28
- export default StreamingTargetPlugin;
30
+ export = StreamingTargetPlugin;
31
+ //# sourceMappingURL=StreamingTargetPlugin.d.ts.map
@@ -1,59 +1,46 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const CommonJsChunkLoadingPlugin_1 = __importDefault(require("./CommonJsChunkLoadingPlugin"));
1
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
+ const require_src_plugins_CommonJsChunkLoadingPlugin = require('./CommonJsChunkLoadingPlugin.js');
3
+
4
+ //#region src/plugins/StreamingTargetPlugin.ts
7
5
  /**
8
- * Class representing a StreamingTargetPlugin
9
- */
10
- class StreamingTargetPlugin {
11
- /**
12
- * Create a StreamingTargetPlugin
13
- * @param {StreamingTargetOptions} options - The options for the plugin
14
- */
15
- constructor(options) {
16
- this.options = options || {};
17
- }
18
- /**
19
- * Apply the plugin to the compiler
20
- * @param {Compiler} compiler - The webpack compiler
21
- */
22
- apply(compiler) {
23
- // When used with Next.js, context is needed to use Next.js webpack
24
- const { webpack } = compiler;
25
- compiler.options.output.chunkFormat = 'commonjs';
26
- if (compiler.options.output.enabledLibraryTypes === undefined) {
27
- compiler.options.output.enabledLibraryTypes = ['commonjs-module'];
28
- }
29
- else {
30
- compiler.options.output.enabledLibraryTypes.push('commonjs-module');
31
- }
32
- compiler.options.output.chunkLoading = 'async-node';
33
- // Disable default config
34
- // FIXME: enabledChunkLoadingTypes is of type 'string[] | undefined'
35
- // Can't use the 'false' value as it isn't the right format,
36
- // Emptying it out ensures theres no other readFileVm added to webpack runtime
37
- compiler.options.output.enabledChunkLoadingTypes = [];
38
- compiler.options.output.environment = {
39
- ...compiler.options.output.environment,
40
- dynamicImport: true,
41
- };
42
- new (webpack?.node?.NodeEnvironmentPlugin ||
43
- require('webpack/lib/node/NodeEnvironmentPlugin'))({
44
- infrastructureLogging: compiler.options.infrastructureLogging,
45
- }).apply(compiler);
46
- new (webpack?.node?.NodeTargetPlugin ||
47
- require('webpack/lib/node/NodeTargetPlugin'))().apply(compiler);
48
- new CommonJsChunkLoadingPlugin_1.default({
49
- asyncChunkLoading: true,
50
- name: this.options.name,
51
- remotes: this.options.remotes,
52
- baseURI: compiler.options.output.publicPath,
53
- promiseBaseURI: this.options.promiseBaseURI,
54
- debug: this.options.debug,
55
- }).apply(compiler);
56
- }
57
- }
6
+ * Class representing a StreamingTargetPlugin
7
+ */
8
+ var StreamingTargetPlugin = class {
9
+ /**
10
+ * Create a StreamingTargetPlugin
11
+ * @param {StreamingTargetOptions} options - The options for the plugin
12
+ */
13
+ constructor(options) {
14
+ this.options = options || {};
15
+ }
16
+ /**
17
+ * Apply the plugin to the compiler
18
+ * @param {Compiler} compiler - The webpack compiler
19
+ */
20
+ apply(compiler) {
21
+ const { webpack } = compiler;
22
+ compiler.options.output.chunkFormat = "commonjs";
23
+ if (compiler.options.output.enabledLibraryTypes === void 0) compiler.options.output.enabledLibraryTypes = ["commonjs-module"];
24
+ else compiler.options.output.enabledLibraryTypes.push("commonjs-module");
25
+ compiler.options.output.chunkLoading = "async-node";
26
+ compiler.options.output.enabledChunkLoadingTypes = [];
27
+ compiler.options.output.environment = {
28
+ ...compiler.options.output.environment,
29
+ dynamicImport: true
30
+ };
31
+ new (webpack?.node?.NodeEnvironmentPlugin || (require("webpack/lib/node/NodeEnvironmentPlugin")))({ infrastructureLogging: compiler.options.infrastructureLogging }).apply(compiler);
32
+ new (webpack?.node?.NodeTargetPlugin || (require("webpack/lib/node/NodeTargetPlugin")))().apply(compiler);
33
+ new require_src_plugins_CommonJsChunkLoadingPlugin.default({
34
+ asyncChunkLoading: true,
35
+ name: this.options.name,
36
+ remotes: this.options.remotes,
37
+ baseURI: compiler.options.output.publicPath,
38
+ promiseBaseURI: this.options.promiseBaseURI,
39
+ debug: this.options.debug
40
+ }).apply(compiler);
41
+ }
42
+ };
43
+
44
+ //#endregion
58
45
  exports.default = StreamingTargetPlugin;
59
46
  //# sourceMappingURL=StreamingTargetPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StreamingTargetPlugin.js","sourceRoot":"","sources":["../../../src/plugins/StreamingTargetPlugin.ts"],"names":[],"mappings":";;;;;AAGA,8FAAsE;AAkBtE;;GAEG;AACH,MAAM,qBAAqB;IAGzB;;;OAGG;IACH,YAAY,OAA+B;QACzC,IAAI,CAAC,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,QAAkB;QACtB,mEAAmE;QACnE,MAAM,EAAE,OAAO,EAAE,GAAG,QAAQ,CAAC;QAE7B,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,GAAG,UAAU,CAAC;QACjD,IAAI,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,mBAAmB,KAAK,SAAS,EAAE,CAAC;YAC9D,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,mBAAmB,GAAG,CAAC,iBAAiB,CAAC,CAAC;QACpE,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACtE,CAAC;QAED,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;QAEpD,yBAAyB;QACzB,oEAAoE;QACpE,4DAA4D;QAC5D,8EAA8E;QAC9E,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,wBAAwB,GAAG,EAAE,CAAC;QACtD,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,GAAG;YACpC,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW;YACtC,aAAa,EAAE,IAAI;SACpB,CAAC;QAEF,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,qBAAqB;YACvC,OAAO,CAAC,wCAAwC,CAAC,CAAC,CAAC;YACnD,qBAAqB,EAAE,QAAQ,CAAC,OAAO,CAAC,qBAAqB;SAC9D,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAEnB,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,gBAAgB;YAClC,OAAO,CAAC,mCAAmC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAClE,IAAI,oCAA0B,CAAC;YAC7B,iBAAiB,EAAE,IAAI;YACvB,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;YACvB,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAiC;YACvD,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU;YAC3C,cAAc,EAAE,IAAI,CAAC,OAAO,CAAC,cAAc;YAC3C,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK;SAC1B,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACrB,CAAC;CACF;AAED,kBAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"StreamingTargetPlugin.js","names":["CommonJsChunkLoadingPlugin"],"sources":["../../../src/plugins/StreamingTargetPlugin.ts"],"sourcesContent":["import type { Compiler, WebpackPluginInstance } from 'webpack';\nimport type { ModuleFederationPluginOptions } from '../types';\n\nimport CommonJsChunkLoadingPlugin from './CommonJsChunkLoadingPlugin';\n\n/**\n * Interface for StreamingTargetOptions which extends ModuleFederationPluginOptions\n * @property {string} promiseBaseURI - The base URI for the promise\n * @property {boolean} debug - Flag to enable/disable debug mode\n */\ninterface StreamingTargetOptions extends ModuleFederationPluginOptions {\n promiseBaseURI?: string;\n debug?: boolean;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\n/**\n * Interface for StreamingTargetContext\n */\ninterface StreamingTargetContext {}\n\n/**\n * Class representing a StreamingTargetPlugin\n */\nclass StreamingTargetPlugin implements WebpackPluginInstance {\n private options: StreamingTargetOptions;\n\n /**\n * Create a StreamingTargetPlugin\n * @param {StreamingTargetOptions} options - The options for the plugin\n */\n constructor(options: StreamingTargetOptions) {\n this.options = options || {};\n }\n\n /**\n * Apply the plugin to the compiler\n * @param {Compiler} compiler - The webpack compiler\n */\n apply(compiler: Compiler) {\n // When used with Next.js, context is needed to use Next.js webpack\n const { webpack } = compiler;\n\n compiler.options.output.chunkFormat = 'commonjs';\n if (compiler.options.output.enabledLibraryTypes === undefined) {\n compiler.options.output.enabledLibraryTypes = ['commonjs-module'];\n } else {\n compiler.options.output.enabledLibraryTypes.push('commonjs-module');\n }\n\n compiler.options.output.chunkLoading = 'async-node';\n\n // Disable default config\n // FIXME: enabledChunkLoadingTypes is of type 'string[] | undefined'\n // Can't use the 'false' value as it isn't the right format,\n // Emptying it out ensures theres no other readFileVm added to webpack runtime\n compiler.options.output.enabledChunkLoadingTypes = [];\n compiler.options.output.environment = {\n ...compiler.options.output.environment,\n dynamicImport: true,\n };\n\n new (webpack?.node?.NodeEnvironmentPlugin ||\n require('webpack/lib/node/NodeEnvironmentPlugin'))({\n infrastructureLogging: compiler.options.infrastructureLogging,\n }).apply(compiler);\n\n new (webpack?.node?.NodeTargetPlugin ||\n require('webpack/lib/node/NodeTargetPlugin'))().apply(compiler);\n new CommonJsChunkLoadingPlugin({\n asyncChunkLoading: true,\n name: this.options.name,\n remotes: this.options.remotes as Record<string, string>,\n baseURI: compiler.options.output.publicPath,\n promiseBaseURI: this.options.promiseBaseURI,\n debug: this.options.debug,\n }).apply(compiler);\n }\n}\n\nexport default StreamingTargetPlugin;\n"],"mappings":";;;;;;;AAwBA,IAAM,wBAAN,MAA6D;;;;;CAO3D,YAAY,SAAiC;AAC3C,OAAK,UAAU,WAAW,EAAE;;;;;;CAO9B,MAAM,UAAoB;EAExB,MAAM,EAAE,YAAY;AAEpB,WAAS,QAAQ,OAAO,cAAc;AACtC,MAAI,SAAS,QAAQ,OAAO,wBAAwB,OAClD,UAAS,QAAQ,OAAO,sBAAsB,CAAC,kBAAkB;MAEjE,UAAS,QAAQ,OAAO,oBAAoB,KAAK,kBAAkB;AAGrE,WAAS,QAAQ,OAAO,eAAe;AAMvC,WAAS,QAAQ,OAAO,2BAA2B,EAAE;AACrD,WAAS,QAAQ,OAAO,cAAc;GACpC,GAAG,SAAS,QAAQ,OAAO;GAC3B,eAAe;GAChB;AAED,OAAK,SAAS,MAAM,0BAClB,QAAQ,yCAAyC,GAAE,EACnD,uBAAuB,SAAS,QAAQ,uBACzC,CAAC,CAAC,MAAM,SAAS;AAElB,OAAK,SAAS,MAAM,qBAClB,QAAQ,oCAAoC,IAAG,CAAC,MAAM,SAAS;AACjE,MAAIA,uDAA2B;GAC7B,mBAAmB;GACnB,MAAM,KAAK,QAAQ;GACnB,SAAS,KAAK,QAAQ;GACtB,SAAS,SAAS,QAAQ,OAAO;GACjC,gBAAgB,KAAK,QAAQ;GAC7B,OAAO,KAAK,QAAQ;GACrB,CAAC,CAAC,MAAM,SAAS"}
@@ -0,0 +1,46 @@
1
+ import { __require } from "../../_virtual/_rolldown/runtime.mjs";
2
+ import DynamicFilesystemChunkLoadingPlugin from "./CommonJsChunkLoadingPlugin.mjs";
3
+
4
+ //#region src/plugins/StreamingTargetPlugin.ts
5
+ /**
6
+ * Class representing a StreamingTargetPlugin
7
+ */
8
+ var StreamingTargetPlugin = class {
9
+ /**
10
+ * Create a StreamingTargetPlugin
11
+ * @param {StreamingTargetOptions} options - The options for the plugin
12
+ */
13
+ constructor(options) {
14
+ this.options = options || {};
15
+ }
16
+ /**
17
+ * Apply the plugin to the compiler
18
+ * @param {Compiler} compiler - The webpack compiler
19
+ */
20
+ apply(compiler) {
21
+ const { webpack } = compiler;
22
+ compiler.options.output.chunkFormat = "commonjs";
23
+ if (compiler.options.output.enabledLibraryTypes === void 0) compiler.options.output.enabledLibraryTypes = ["commonjs-module"];
24
+ else compiler.options.output.enabledLibraryTypes.push("commonjs-module");
25
+ compiler.options.output.chunkLoading = "async-node";
26
+ compiler.options.output.enabledChunkLoadingTypes = [];
27
+ compiler.options.output.environment = {
28
+ ...compiler.options.output.environment,
29
+ dynamicImport: true
30
+ };
31
+ new (webpack?.node?.NodeEnvironmentPlugin || (__require("webpack/lib/node/NodeEnvironmentPlugin")))({ infrastructureLogging: compiler.options.infrastructureLogging }).apply(compiler);
32
+ new (webpack?.node?.NodeTargetPlugin || (__require("webpack/lib/node/NodeTargetPlugin")))().apply(compiler);
33
+ new DynamicFilesystemChunkLoadingPlugin({
34
+ asyncChunkLoading: true,
35
+ name: this.options.name,
36
+ remotes: this.options.remotes,
37
+ baseURI: compiler.options.output.publicPath,
38
+ promiseBaseURI: this.options.promiseBaseURI,
39
+ debug: this.options.debug
40
+ }).apply(compiler);
41
+ }
42
+ };
43
+
44
+ //#endregion
45
+ export { StreamingTargetPlugin as default };
46
+ //# sourceMappingURL=StreamingTargetPlugin.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StreamingTargetPlugin.mjs","names":["CommonJsChunkLoadingPlugin"],"sources":["../../../src/plugins/StreamingTargetPlugin.ts"],"sourcesContent":["import type { Compiler, WebpackPluginInstance } from 'webpack';\nimport type { ModuleFederationPluginOptions } from '../types';\n\nimport CommonJsChunkLoadingPlugin from './CommonJsChunkLoadingPlugin';\n\n/**\n * Interface for StreamingTargetOptions which extends ModuleFederationPluginOptions\n * @property {string} promiseBaseURI - The base URI for the promise\n * @property {boolean} debug - Flag to enable/disable debug mode\n */\ninterface StreamingTargetOptions extends ModuleFederationPluginOptions {\n promiseBaseURI?: string;\n debug?: boolean;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\n/**\n * Interface for StreamingTargetContext\n */\ninterface StreamingTargetContext {}\n\n/**\n * Class representing a StreamingTargetPlugin\n */\nclass StreamingTargetPlugin implements WebpackPluginInstance {\n private options: StreamingTargetOptions;\n\n /**\n * Create a StreamingTargetPlugin\n * @param {StreamingTargetOptions} options - The options for the plugin\n */\n constructor(options: StreamingTargetOptions) {\n this.options = options || {};\n }\n\n /**\n * Apply the plugin to the compiler\n * @param {Compiler} compiler - The webpack compiler\n */\n apply(compiler: Compiler) {\n // When used with Next.js, context is needed to use Next.js webpack\n const { webpack } = compiler;\n\n compiler.options.output.chunkFormat = 'commonjs';\n if (compiler.options.output.enabledLibraryTypes === undefined) {\n compiler.options.output.enabledLibraryTypes = ['commonjs-module'];\n } else {\n compiler.options.output.enabledLibraryTypes.push('commonjs-module');\n }\n\n compiler.options.output.chunkLoading = 'async-node';\n\n // Disable default config\n // FIXME: enabledChunkLoadingTypes is of type 'string[] | undefined'\n // Can't use the 'false' value as it isn't the right format,\n // Emptying it out ensures theres no other readFileVm added to webpack runtime\n compiler.options.output.enabledChunkLoadingTypes = [];\n compiler.options.output.environment = {\n ...compiler.options.output.environment,\n dynamicImport: true,\n };\n\n new (webpack?.node?.NodeEnvironmentPlugin ||\n require('webpack/lib/node/NodeEnvironmentPlugin'))({\n infrastructureLogging: compiler.options.infrastructureLogging,\n }).apply(compiler);\n\n new (webpack?.node?.NodeTargetPlugin ||\n require('webpack/lib/node/NodeTargetPlugin'))().apply(compiler);\n new CommonJsChunkLoadingPlugin({\n asyncChunkLoading: true,\n name: this.options.name,\n remotes: this.options.remotes as Record<string, string>,\n baseURI: compiler.options.output.publicPath,\n promiseBaseURI: this.options.promiseBaseURI,\n debug: this.options.debug,\n }).apply(compiler);\n }\n}\n\nexport default StreamingTargetPlugin;\n"],"mappings":";;;;;;;AAwBA,IAAM,wBAAN,MAA6D;;;;;CAO3D,YAAY,SAAiC;AAC3C,OAAK,UAAU,WAAW,EAAE;;;;;;CAO9B,MAAM,UAAoB;EAExB,MAAM,EAAE,YAAY;AAEpB,WAAS,QAAQ,OAAO,cAAc;AACtC,MAAI,SAAS,QAAQ,OAAO,wBAAwB,OAClD,UAAS,QAAQ,OAAO,sBAAsB,CAAC,kBAAkB;MAEjE,UAAS,QAAQ,OAAO,oBAAoB,KAAK,kBAAkB;AAGrE,WAAS,QAAQ,OAAO,eAAe;AAMvC,WAAS,QAAQ,OAAO,2BAA2B,EAAE;AACrD,WAAS,QAAQ,OAAO,cAAc;GACpC,GAAG,SAAS,QAAQ,OAAO;GAC3B,eAAe;GAChB;AAED,OAAK,SAAS,MAAM,oCACV,yCAAyC,GAAE,EACnD,uBAAuB,SAAS,QAAQ,uBACzC,CAAC,CAAC,MAAM,SAAS;AAElB,OAAK,SAAS,MAAM,+BACV,oCAAoC,IAAG,CAAC,MAAM,SAAS;AACjE,MAAIA,oCAA2B;GAC7B,mBAAmB;GACnB,MAAM,KAAK,QAAQ;GACnB,SAAS,KAAK,QAAQ;GACtB,SAAS,SAAS,QAAQ,OAAO;GACjC,gBAAgB,KAAK,QAAQ;GAC7B,OAAO,KAAK,QAAQ;GACrB,CAAC,CAAC,MAAM,SAAS"}
@@ -0,0 +1,49 @@
1
+ import { ModuleFederationPluginOptions } from "../types/index.mjs";
2
+ import { Compiler, container } from "webpack";
3
+
4
+ //#region src/plugins/UniversalFederationPlugin.d.ts
5
+ /**
6
+ * Interface for NodeFederationOptions
7
+ * @property {boolean} isServer - Indicates if the server is running
8
+ * @property {string} [promiseBaseURI] - The base URI for the promise
9
+ * @property {boolean} [debug] - Indicates if debug mode is enabled
10
+ */
11
+ interface NodeFederationOptions extends ModuleFederationPluginOptions {
12
+ isServer: boolean;
13
+ promiseBaseURI?: string;
14
+ debug?: boolean;
15
+ useRuntimePlugin?: boolean;
16
+ }
17
+ /**
18
+ * Interface for NodeFederationContext
19
+ * @property {typeof container.ModuleFederationPlugin} [ModuleFederationPlugin] - The ModuleFederationPlugin from webpack container
20
+ */
21
+ interface NodeFederationContext {
22
+ ModuleFederationPlugin?: typeof container.ModuleFederationPlugin;
23
+ }
24
+ /**
25
+ * Class representing a UniversalFederationPlugin
26
+ */
27
+ declare class UniversalFederationPlugin {
28
+ private _options;
29
+ private context;
30
+ private name;
31
+ /**
32
+ * Create a UniversalFederationPlugin
33
+ * @param {NodeFederationOptions} options - The options for the plugin
34
+ * @param {NodeFederationContext} context - The context for the plugin
35
+ */
36
+ constructor(options: NodeFederationOptions, context: NodeFederationContext);
37
+ private updateCompilerOptions;
38
+ /**
39
+ * Apply the plugin to the compiler
40
+ * @param {Compiler} compiler - The webpack compiler
41
+ */
42
+ apply(compiler: Compiler): void;
43
+ }
44
+ /**
45
+ * Exporting UniversalFederationPlugin as default
46
+ */
47
+ //#endregion
48
+ export { UniversalFederationPlugin as default };
49
+ //# sourceMappingURL=UniversalFederationPlugin.d.mts.map
@@ -1,5 +1,7 @@
1
- import { ModuleFederationPluginOptions } from '../types';
2
- import type { Compiler, container } from 'webpack';
1
+ import { ModuleFederationPluginOptions } from "../types/index.js";
2
+ import { Compiler, container } from "webpack";
3
+
4
+ //#region src/plugins/UniversalFederationPlugin.d.ts
3
5
  /**
4
6
  * Interface for NodeFederationOptions
5
7
  * @property {boolean} isServer - Indicates if the server is running
@@ -7,39 +9,40 @@ import type { Compiler, container } from 'webpack';
7
9
  * @property {boolean} [debug] - Indicates if debug mode is enabled
8
10
  */
9
11
  interface NodeFederationOptions extends ModuleFederationPluginOptions {
10
- isServer: boolean;
11
- promiseBaseURI?: string;
12
- debug?: boolean;
13
- useRuntimePlugin?: boolean;
12
+ isServer: boolean;
13
+ promiseBaseURI?: string;
14
+ debug?: boolean;
15
+ useRuntimePlugin?: boolean;
14
16
  }
15
17
  /**
16
18
  * Interface for NodeFederationContext
17
19
  * @property {typeof container.ModuleFederationPlugin} [ModuleFederationPlugin] - The ModuleFederationPlugin from webpack container
18
20
  */
19
21
  interface NodeFederationContext {
20
- ModuleFederationPlugin?: typeof container.ModuleFederationPlugin;
22
+ ModuleFederationPlugin?: typeof container.ModuleFederationPlugin;
21
23
  }
22
24
  /**
23
25
  * Class representing a UniversalFederationPlugin
24
26
  */
25
27
  declare class UniversalFederationPlugin {
26
- private _options;
27
- private context;
28
- private name;
29
- /**
30
- * Create a UniversalFederationPlugin
31
- * @param {NodeFederationOptions} options - The options for the plugin
32
- * @param {NodeFederationContext} context - The context for the plugin
33
- */
34
- constructor(options: NodeFederationOptions, context: NodeFederationContext);
35
- private updateCompilerOptions;
36
- /**
37
- * Apply the plugin to the compiler
38
- * @param {Compiler} compiler - The webpack compiler
39
- */
40
- apply(compiler: Compiler): void;
28
+ private _options;
29
+ private context;
30
+ private name;
31
+ /**
32
+ * Create a UniversalFederationPlugin
33
+ * @param {NodeFederationOptions} options - The options for the plugin
34
+ * @param {NodeFederationContext} context - The context for the plugin
35
+ */
36
+ constructor(options: NodeFederationOptions, context: NodeFederationContext);
37
+ private updateCompilerOptions;
38
+ /**
39
+ * Apply the plugin to the compiler
40
+ * @param {Compiler} compiler - The webpack compiler
41
+ */
42
+ apply(compiler: Compiler): void;
41
43
  }
42
44
  /**
43
45
  * Exporting UniversalFederationPlugin as default
44
46
  */
45
- export default UniversalFederationPlugin;
47
+ export = UniversalFederationPlugin;
48
+ //# sourceMappingURL=UniversalFederationPlugin.d.ts.map