@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.
- package/dist/_virtual/_rolldown/runtime.js +31 -0
- package/dist/_virtual/_rolldown/runtime.mjs +8 -0
- package/dist/plugins/ChunkCorrelationPlugin.js +308 -0
- package/dist/plugins/ChunkCorrelationPlugin.js.map +1 -0
- package/dist/plugins/ChunkCorrelationPlugin.mjs +305 -0
- package/dist/plugins/ChunkCorrelationPlugin.mjs.map +1 -0
- package/dist/src/filesystem/stratagies.d.mts +21 -0
- package/dist/src/filesystem/stratagies.d.ts +10 -7
- package/dist/src/filesystem/stratagies.js +97 -116
- package/dist/src/filesystem/stratagies.js.map +1 -1
- package/dist/src/filesystem/stratagies.mjs +103 -0
- package/dist/src/filesystem/stratagies.mjs.map +1 -0
- package/dist/src/index.d.mts +8 -0
- package/dist/src/index.d.ts +8 -7
- package/dist/src/index.js +16 -22
- package/dist/src/index.mjs +9 -0
- package/dist/src/plugins/AutomaticPublicPathPlugin.d.mts +12 -0
- package/dist/src/plugins/AutomaticPublicPathPlugin.d.ts +9 -7
- package/dist/src/plugins/AutomaticPublicPathPlugin.js +26 -35
- package/dist/src/plugins/AutomaticPublicPathPlugin.js.map +1 -1
- package/dist/src/plugins/AutomaticPublicPathPlugin.mjs +28 -0
- package/dist/src/plugins/AutomaticPublicPathPlugin.mjs.map +1 -0
- package/dist/src/plugins/ChunkCorrelationPlugin.d.mts +5 -0
- package/dist/src/plugins/ChunkCorrelationPlugin.d.ts +4 -61
- package/dist/src/plugins/ChunkCorrelationPlugin.js +8 -440
- package/dist/src/plugins/ChunkCorrelationPlugin.js.map +1 -1
- package/dist/src/plugins/ChunkCorrelationPlugin.mjs +8 -0
- package/dist/src/plugins/ChunkCorrelationPlugin.mjs.map +1 -0
- package/dist/src/plugins/CommonJsChunkLoadingPlugin.d.mts +21 -0
- package/dist/src/plugins/CommonJsChunkLoadingPlugin.d.ts +16 -13
- package/dist/src/plugins/CommonJsChunkLoadingPlugin.js +68 -118
- package/dist/src/plugins/CommonJsChunkLoadingPlugin.js.map +1 -1
- package/dist/src/plugins/CommonJsChunkLoadingPlugin.mjs +70 -0
- package/dist/src/plugins/CommonJsChunkLoadingPlugin.mjs.map +1 -0
- package/dist/src/plugins/DynamicFilesystemChunkLoadingRuntimeModule.d.mts +46 -0
- package/dist/src/plugins/DynamicFilesystemChunkLoadingRuntimeModule.d.ts +39 -34
- package/dist/src/plugins/DynamicFilesystemChunkLoadingRuntimeModule.js +110 -126
- package/dist/src/plugins/DynamicFilesystemChunkLoadingRuntimeModule.js.map +1 -1
- package/dist/src/plugins/DynamicFilesystemChunkLoadingRuntimeModule.mjs +111 -0
- package/dist/src/plugins/DynamicFilesystemChunkLoadingRuntimeModule.mjs.map +1 -0
- package/dist/src/plugins/EntryChunkTrackerPlugin.d.mts +17 -0
- package/dist/src/plugins/EntryChunkTrackerPlugin.d.ts +14 -10
- package/dist/src/plugins/EntryChunkTrackerPlugin.js +30 -32
- package/dist/src/plugins/EntryChunkTrackerPlugin.js.map +1 -1
- package/dist/src/plugins/EntryChunkTrackerPlugin.mjs +38 -0
- package/dist/src/plugins/EntryChunkTrackerPlugin.mjs.map +1 -0
- package/dist/src/plugins/NodeFederationPlugin.d.mts +54 -0
- package/dist/src/plugins/NodeFederationPlugin.d.ts +33 -26
- package/dist/src/plugins/NodeFederationPlugin.js +69 -84
- package/dist/src/plugins/NodeFederationPlugin.js.map +1 -1
- package/dist/src/plugins/NodeFederationPlugin.mjs +70 -0
- package/dist/src/plugins/NodeFederationPlugin.mjs.map +1 -0
- package/dist/src/plugins/RemotePublicPathRuntimeModule.d.mts +15 -0
- package/dist/src/plugins/RemotePublicPathRuntimeModule.d.ts +12 -8
- package/dist/src/plugins/RemotePublicPathRuntimeModule.js +34 -35
- package/dist/src/plugins/RemotePublicPathRuntimeModule.js.map +1 -1
- package/dist/src/plugins/RemotePublicPathRuntimeModule.mjs +132 -0
- package/dist/src/plugins/RemotePublicPathRuntimeModule.mjs.map +1 -0
- package/dist/src/plugins/StreamingTargetPlugin.d.mts +32 -0
- package/dist/src/plugins/StreamingTargetPlugin.d.ts +19 -16
- package/dist/src/plugins/StreamingTargetPlugin.js +43 -56
- package/dist/src/plugins/StreamingTargetPlugin.js.map +1 -1
- package/dist/src/plugins/StreamingTargetPlugin.mjs +46 -0
- package/dist/src/plugins/StreamingTargetPlugin.mjs.map +1 -0
- package/dist/src/plugins/UniversalFederationPlugin.d.mts +49 -0
- package/dist/src/plugins/UniversalFederationPlugin.d.ts +26 -23
- package/dist/src/plugins/UniversalFederationPlugin.js +58 -81
- package/dist/src/plugins/UniversalFederationPlugin.js.map +1 -1
- package/dist/src/plugins/UniversalFederationPlugin.mjs +61 -0
- package/dist/src/plugins/UniversalFederationPlugin.mjs.map +1 -0
- package/dist/src/plugins/UniverseEntryChunkTrackerPlugin.d.mts +9 -0
- package/dist/src/plugins/UniverseEntryChunkTrackerPlugin.d.ts +6 -3
- package/dist/src/plugins/UniverseEntryChunkTrackerPlugin.js +17 -17
- package/dist/src/plugins/UniverseEntryChunkTrackerPlugin.js.map +1 -1
- package/dist/src/plugins/UniverseEntryChunkTrackerPlugin.mjs +25 -0
- package/dist/src/plugins/UniverseEntryChunkTrackerPlugin.mjs.map +1 -0
- package/dist/src/plugins/webpackChunkUtilities.d.mts +55 -0
- package/dist/src/plugins/webpackChunkUtilities.d.ts +14 -9
- package/dist/src/plugins/webpackChunkUtilities.js +195 -257
- package/dist/src/plugins/webpackChunkUtilities.js.map +1 -1
- package/dist/src/plugins/webpackChunkUtilities.mjs +234 -0
- package/dist/src/plugins/webpackChunkUtilities.mjs.map +1 -0
- package/dist/src/recordDynamicRemoteEntryHashPlugin.d.mts +7 -0
- package/dist/src/recordDynamicRemoteEntryHashPlugin.d.ts +5 -2
- package/dist/src/recordDynamicRemoteEntryHashPlugin.js +24 -61
- package/dist/src/recordDynamicRemoteEntryHashPlugin.js.map +1 -1
- package/dist/src/recordDynamicRemoteEntryHashPlugin.mjs +26 -0
- package/dist/src/recordDynamicRemoteEntryHashPlugin.mjs.map +1 -0
- package/dist/src/runtimePlugin.d.mts +27 -0
- package/dist/src/runtimePlugin.d.ts +24 -19
- package/dist/src/runtimePlugin.js +157 -252
- package/dist/src/runtimePlugin.js.map +1 -1
- package/dist/src/runtimePlugin.mjs +169 -0
- package/dist/src/runtimePlugin.mjs.map +1 -0
- package/dist/src/types/index.d.mts +8 -0
- package/dist/src/types/index.d.ts +8 -3
- package/dist/src/types/index.js +1 -3
- package/dist/src/types/index.mjs +1 -0
- package/dist/src/utils/flush-chunks.d.mts +15 -0
- package/dist/src/utils/flush-chunks.d.ts +7 -3
- package/dist/src/utils/flush-chunks.js +87 -161
- package/dist/src/utils/flush-chunks.js.map +1 -1
- package/dist/src/utils/flush-chunks.mjs +99 -0
- package/dist/src/utils/flush-chunks.mjs.map +1 -0
- package/dist/src/utils/hot-reload.d.mts +16 -0
- package/dist/src/utils/hot-reload.d.ts +14 -10
- package/dist/src/utils/hot-reload.js +177 -264
- package/dist/src/utils/hot-reload.js.map +1 -1
- package/dist/src/utils/hot-reload.mjs +194 -0
- package/dist/src/utils/hot-reload.mjs.map +1 -0
- package/dist/src/utils/index.d.mts +3 -0
- package/dist/src/utils/index.d.ts +3 -2
- package/dist/src/utils/index.js +15 -19
- package/dist/src/utils/index.mjs +4 -0
- package/package.json +59 -15
- package/dist/jest.config.d.ts +0 -11
- package/dist/jest.config.js +0 -19
- package/dist/jest.config.js.map +0 -1
- package/dist/package.json +0 -82
- package/dist/src/index.js.map +0 -1
- package/dist/src/types/index.js.map +0 -1
- 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
|
|
2
|
-
import
|
|
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
|
-
|
|
10
|
-
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
|
30
|
+
export = StreamingTargetPlugin;
|
|
31
|
+
//# sourceMappingURL=StreamingTargetPlugin.d.ts.map
|
|
@@ -1,59 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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","
|
|
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
|
|
2
|
-
import
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
22
|
+
ModuleFederationPlugin?: typeof container.ModuleFederationPlugin;
|
|
21
23
|
}
|
|
22
24
|
/**
|
|
23
25
|
* Class representing a UniversalFederationPlugin
|
|
24
26
|
*/
|
|
25
27
|
declare class UniversalFederationPlugin {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
|
47
|
+
export = UniversalFederationPlugin;
|
|
48
|
+
//# sourceMappingURL=UniversalFederationPlugin.d.ts.map
|