@module-federation/sdk 0.0.0-next-20240402191904 → 0.0.0-next-20240403162201
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/index.cjs.js
CHANGED
|
@@ -1040,11 +1040,13 @@ function importNodeModule(name) {
|
|
|
1040
1040
|
if (!name) {
|
|
1041
1041
|
throw new Error("import specifier is required");
|
|
1042
1042
|
}
|
|
1043
|
-
var
|
|
1044
|
-
|
|
1045
|
-
|
|
1043
|
+
var req = eval('typeof require !== "undefined" ? require : undefined');
|
|
1044
|
+
var importModule = new Function("name,require", "\n if (typeof require !== 'undefined') {\n // Node.js environment, use require\n return Promise.resolve(require(name));\n } else {\n // Browser environment or where require is undefined, use dynamic import\n return import(name);\n }\n ");
|
|
1045
|
+
return importModule(name, req).then(function(res) {
|
|
1046
|
+
return (res === null || res === void 0 ? void 0 : res.default) || res;
|
|
1046
1047
|
}).catch(function(error) {
|
|
1047
|
-
console.error("Error importing module ".concat(name, ":")
|
|
1048
|
+
console.error("Error importing module ".concat(name, ":"));
|
|
1049
|
+
console.error(error);
|
|
1048
1050
|
throw error;
|
|
1049
1051
|
});
|
|
1050
1052
|
}
|
package/dist/index.esm.js
CHANGED
|
@@ -1036,11 +1036,13 @@ function importNodeModule(name) {
|
|
|
1036
1036
|
if (!name) {
|
|
1037
1037
|
throw new Error("import specifier is required");
|
|
1038
1038
|
}
|
|
1039
|
-
var
|
|
1040
|
-
|
|
1041
|
-
|
|
1039
|
+
var req = eval('typeof require !== "undefined" ? require : undefined');
|
|
1040
|
+
var importModule = new Function("name,require", "\n if (typeof require !== 'undefined') {\n // Node.js environment, use require\n return Promise.resolve(require(name));\n } else {\n // Browser environment or where require is undefined, use dynamic import\n return import(name);\n }\n ");
|
|
1041
|
+
return importModule(name, req).then(function(res) {
|
|
1042
|
+
return (res === null || res === void 0 ? void 0 : res.default) || res;
|
|
1042
1043
|
}).catch(function(error) {
|
|
1043
|
-
console.error("Error importing module ".concat(name, ":")
|
|
1044
|
+
console.error("Error importing module ".concat(name, ":"));
|
|
1045
|
+
console.error(error);
|
|
1044
1046
|
throw error;
|
|
1045
1047
|
});
|
|
1046
1048
|
}
|
|
@@ -38,6 +38,10 @@ export type UmdNamedDefine = boolean;
|
|
|
38
38
|
* The name of the runtime chunk. If set a runtime chunk with this name is created or an existing entrypoint is used as runtime.
|
|
39
39
|
*/
|
|
40
40
|
export type EntryRuntime = false | string;
|
|
41
|
+
export type RuntimePlugin = string | {
|
|
42
|
+
import: string;
|
|
43
|
+
async: boolean;
|
|
44
|
+
};
|
|
41
45
|
export interface ContainerPluginOptions {
|
|
42
46
|
/**
|
|
43
47
|
* Modules that should be exposed by this container. When provided, property name is used as public name, otherwise public name is automatically inferred from request.
|
|
@@ -66,7 +70,7 @@ export interface ContainerPluginOptions {
|
|
|
66
70
|
/**
|
|
67
71
|
* Runtime plugin file paths or package name.
|
|
68
72
|
*/
|
|
69
|
-
runtimePlugins?:
|
|
73
|
+
runtimePlugins?: RuntimePlugin[];
|
|
70
74
|
}
|
|
71
75
|
/**
|
|
72
76
|
* Modules that should be exposed by this container. Property names are used as public paths.
|