@ice/mf-runtime 0.0.8-beta.6 → 0.0.9

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/es2017/index.d.ts CHANGED
@@ -3,4 +3,4 @@ export { loadRemote, registerPlugins } from '@module-federation/runtime';
3
3
  export * from './FallBack';
4
4
  export * from './RemoteModule';
5
5
  export declare function init(options: ExtendedUserOptions, microMods?: MicroMod[]): void;
6
- export declare function initByMicroMods(microMods: MicroMod[]): void;
6
+ export declare function initByMicroMods(microMods: MicroMod[], hostName?: string): void;
package/es2017/index.js CHANGED
@@ -18,7 +18,7 @@ function generateUniqueId() {
18
18
  const baseName = getBasename().split('/').join('_');
19
19
  return `${prefix}_${baseName}`;
20
20
  }
21
- export function initByMicroMods(microMods) {
21
+ export function initByMicroMods(microMods, hostName) {
22
22
  const remotes = microMods.map((microMod)=>{
23
23
  var _microMod_remoteEntry;
24
24
  const isLegacy = !((_microMod_remoteEntry = microMod.remoteEntry) === null || _microMod_remoteEntry === void 0 ? void 0 : _microMod_remoteEntry.match(/\/mf\/remoteEntry\.js$/));
@@ -34,6 +34,6 @@ export function initByMicroMods(microMods) {
34
34
  });
35
35
  init({
36
36
  remotes,
37
- name: generateUniqueId()
37
+ name: generateUniqueId() || hostName
38
38
  }, microMods);
39
39
  }
package/esm/index.d.ts CHANGED
@@ -3,4 +3,4 @@ export { loadRemote, registerPlugins } from '@module-federation/runtime';
3
3
  export * from './FallBack';
4
4
  export * from './RemoteModule';
5
5
  export declare function init(options: ExtendedUserOptions, microMods?: MicroMod[]): void;
6
- export declare function initByMicroMods(microMods: MicroMod[]): void;
6
+ export declare function initByMicroMods(microMods: MicroMod[], hostName?: string): void;
package/esm/index.js CHANGED
@@ -18,7 +18,7 @@ function generateUniqueId() {
18
18
  var baseName = getBasename().split("/").join("_");
19
19
  return "".concat(prefix, "_").concat(baseName);
20
20
  }
21
- export function initByMicroMods(microMods) {
21
+ export function initByMicroMods(microMods, hostName) {
22
22
  var remotes = microMods.map(function(microMod) {
23
23
  var _microMod_remoteEntry;
24
24
  var isLegacy = !((_microMod_remoteEntry = microMod.remoteEntry) === null || _microMod_remoteEntry === void 0 ? void 0 : _microMod_remoteEntry.match(/\/mf\/remoteEntry\.js$/));
@@ -34,6 +34,6 @@ export function initByMicroMods(microMods) {
34
34
  });
35
35
  init({
36
36
  remotes: remotes,
37
- name: generateUniqueId()
37
+ name: generateUniqueId() || hostName
38
38
  }, microMods);
39
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ice/mf-runtime",
3
- "version": "0.0.8-beta.6",
3
+ "version": "0.0.9",
4
4
  "description": "ice mf runtime",
5
5
  "files": [
6
6
  "esm",