@module-federation/sdk 0.0.0-next-20240404164914 → 0.0.0-next-20240408040658

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,13 +1040,11 @@ function importNodeModule(name) {
1040
1040
  if (!name) {
1041
1041
  throw new Error("import specifier is required");
1042
1042
  }
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;
1043
+ var importModule = new Function("name", "return import(name)");
1044
+ return importModule(name).then(function(res) {
1045
+ return res.default;
1047
1046
  }).catch(function(error) {
1048
- console.error("Error importing module ".concat(name, ":"));
1049
- console.error(error);
1047
+ console.error("Error importing module ".concat(name, ":"), error);
1050
1048
  throw error;
1051
1049
  });
1052
1050
  }
package/dist/index.esm.js CHANGED
@@ -1036,13 +1036,11 @@ function importNodeModule(name) {
1036
1036
  if (!name) {
1037
1037
  throw new Error("import specifier is required");
1038
1038
  }
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;
1039
+ var importModule = new Function("name", "return import(name)");
1040
+ return importModule(name).then(function(res) {
1041
+ return res.default;
1043
1042
  }).catch(function(error) {
1044
- console.error("Error importing module ".concat(name, ":"));
1045
- console.error(error);
1043
+ console.error("Error importing module ".concat(name, ":"), error);
1046
1044
  throw error;
1047
1045
  });
1048
1046
  }
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/sdk",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "license": "MIT",
5
5
  "description": "A sdk for support module federation",
6
6
  "keywords": [
@@ -38,10 +38,6 @@ 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
- };
45
41
  export interface ContainerPluginOptions {
46
42
  /**
47
43
  * 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.
@@ -70,7 +66,7 @@ export interface ContainerPluginOptions {
70
66
  /**
71
67
  * Runtime plugin file paths or package name.
72
68
  */
73
- runtimePlugins?: RuntimePlugin[];
69
+ runtimePlugins?: string[];
74
70
  }
75
71
  /**
76
72
  * Modules that should be exposed by this container. Property names are used as public paths.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/sdk",
3
- "version": "0.0.0-next-20240404164914",
3
+ "version": "0.0.0-next-20240408040658",
4
4
  "license": "MIT",
5
5
  "description": "A sdk for support module federation",
6
6
  "keywords": [