@module-federation/manifest 0.0.0-next-20240515125630 → 0.0.0-next-20240516035452

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
@@ -668,45 +668,42 @@ var ManifestManager = /*#__PURE__*/ function() {
668
668
  compilation = options.compilation, publicPath = options.publicPath, stats = options.stats, compiler = options.compiler, bundler = options.bundler, additionalData = options.additionalData;
669
669
  disableEmit = extraOptions.disableEmit;
670
670
  manifest = _object_spread$2({}, stats);
671
- manifest.exposes = Object.keys(stats.exposes).reduce(function(sum, cur) {
672
- var statsExpose = manifest.exposes[cur];
671
+ manifest.exposes = stats.exposes.reduce(function(sum, cur) {
673
672
  var expose = {
674
- id: statsExpose.id,
675
- name: statsExpose.name,
676
- assets: statsExpose.assets,
677
- path: statsExpose.path
673
+ id: cur.id,
674
+ name: cur.name,
675
+ assets: cur.assets,
676
+ path: cur.path
678
677
  };
679
678
  sum.push(expose);
680
679
  return sum;
681
680
  }, []);
682
- manifest.shared = Object.keys(stats.shared).reduce(function(sum, cur) {
683
- var statsShared = manifest.shared[cur];
681
+ manifest.shared = stats.shared.reduce(function(sum, cur) {
684
682
  var shared = {
685
- id: statsShared.id,
686
- name: statsShared.name,
687
- version: statsShared.version,
688
- singleton: statsShared.singleton,
689
- requiredVersion: statsShared.requiredVersion,
690
- hash: statsShared.hash,
691
- assets: statsShared.assets
683
+ id: cur.id,
684
+ name: cur.name,
685
+ version: cur.version,
686
+ singleton: cur.singleton,
687
+ requiredVersion: cur.requiredVersion,
688
+ hash: cur.hash,
689
+ assets: cur.assets
692
690
  };
693
691
  sum.push(shared);
694
692
  return sum;
695
693
  }, []);
696
- manifest.remotes = Object.keys(stats.remotes).reduce(function(sum, cur) {
697
- var statsRemote = manifest.remotes[cur];
694
+ manifest.remotes = stats.remotes.reduce(function(sum, cur) {
698
695
  // @ts-ignore version/entry will be added as follow
699
696
  var remote = {
700
- federationContainerName: statsRemote.federationContainerName,
701
- moduleName: statsRemote.moduleName,
702
- alias: statsRemote.alias
697
+ federationContainerName: cur.federationContainerName,
698
+ moduleName: cur.moduleName,
699
+ alias: cur.alias
703
700
  };
704
- if ('entry' in statsRemote) {
701
+ if ('entry' in cur) {
705
702
  // @ts-ignore
706
- remote.entry = statsRemote.entry;
707
- } else if ('version' in statsRemote) {
703
+ remote.entry = cur.entry;
704
+ } else if ('version' in cur) {
708
705
  // @ts-ignore
709
- remote.entry = statsRemote.version;
706
+ remote.entry = cur.version;
710
707
  }
711
708
  sum.push(remote);
712
709
  return sum;
@@ -1778,10 +1775,13 @@ var StatsManager = /*#__PURE__*/ function() {
1778
1775
  ]);
1779
1776
  disableEmit = extraOptions.disableEmit;
1780
1777
  existedStats = compilation.getAsset(_this.fileName);
1781
- if (existedStats) {
1778
+ if (existedStats && !isDev()) {
1782
1779
  return [
1783
1780
  2,
1784
- JSON.parse(existedStats.source.source().toString())
1781
+ {
1782
+ stats: JSON.parse(existedStats.source.source().toString()),
1783
+ filename: _this.fileName
1784
+ }
1785
1785
  ];
1786
1786
  }
1787
1787
  _this__options = _this._options, tmp = _this__options.manifest, manifestOptions = tmp === void 0 ? {} : tmp;
package/dist/index.esm.js CHANGED
@@ -659,45 +659,42 @@ var ManifestManager = /*#__PURE__*/ function() {
659
659
  compilation = options.compilation, publicPath = options.publicPath, stats = options.stats, compiler = options.compiler, bundler = options.bundler, additionalData = options.additionalData;
660
660
  disableEmit = extraOptions.disableEmit;
661
661
  manifest = _object_spread$2({}, stats);
662
- manifest.exposes = Object.keys(stats.exposes).reduce(function(sum, cur) {
663
- var statsExpose = manifest.exposes[cur];
662
+ manifest.exposes = stats.exposes.reduce(function(sum, cur) {
664
663
  var expose = {
665
- id: statsExpose.id,
666
- name: statsExpose.name,
667
- assets: statsExpose.assets,
668
- path: statsExpose.path
664
+ id: cur.id,
665
+ name: cur.name,
666
+ assets: cur.assets,
667
+ path: cur.path
669
668
  };
670
669
  sum.push(expose);
671
670
  return sum;
672
671
  }, []);
673
- manifest.shared = Object.keys(stats.shared).reduce(function(sum, cur) {
674
- var statsShared = manifest.shared[cur];
672
+ manifest.shared = stats.shared.reduce(function(sum, cur) {
675
673
  var shared = {
676
- id: statsShared.id,
677
- name: statsShared.name,
678
- version: statsShared.version,
679
- singleton: statsShared.singleton,
680
- requiredVersion: statsShared.requiredVersion,
681
- hash: statsShared.hash,
682
- assets: statsShared.assets
674
+ id: cur.id,
675
+ name: cur.name,
676
+ version: cur.version,
677
+ singleton: cur.singleton,
678
+ requiredVersion: cur.requiredVersion,
679
+ hash: cur.hash,
680
+ assets: cur.assets
683
681
  };
684
682
  sum.push(shared);
685
683
  return sum;
686
684
  }, []);
687
- manifest.remotes = Object.keys(stats.remotes).reduce(function(sum, cur) {
688
- var statsRemote = manifest.remotes[cur];
685
+ manifest.remotes = stats.remotes.reduce(function(sum, cur) {
689
686
  // @ts-ignore version/entry will be added as follow
690
687
  var remote = {
691
- federationContainerName: statsRemote.federationContainerName,
692
- moduleName: statsRemote.moduleName,
693
- alias: statsRemote.alias
688
+ federationContainerName: cur.federationContainerName,
689
+ moduleName: cur.moduleName,
690
+ alias: cur.alias
694
691
  };
695
- if ('entry' in statsRemote) {
692
+ if ('entry' in cur) {
696
693
  // @ts-ignore
697
- remote.entry = statsRemote.entry;
698
- } else if ('version' in statsRemote) {
694
+ remote.entry = cur.entry;
695
+ } else if ('version' in cur) {
699
696
  // @ts-ignore
700
- remote.entry = statsRemote.version;
697
+ remote.entry = cur.version;
701
698
  }
702
699
  sum.push(remote);
703
700
  return sum;
@@ -1769,10 +1766,13 @@ var StatsManager = /*#__PURE__*/ function() {
1769
1766
  ]);
1770
1767
  disableEmit = extraOptions.disableEmit;
1771
1768
  existedStats = compilation.getAsset(_this.fileName);
1772
- if (existedStats) {
1769
+ if (existedStats && !isDev()) {
1773
1770
  return [
1774
1771
  2,
1775
- JSON.parse(existedStats.source.source().toString())
1772
+ {
1773
+ stats: JSON.parse(existedStats.source.source().toString()),
1774
+ filename: _this.fileName
1775
+ }
1776
1776
  ];
1777
1777
  }
1778
1778
  _this__options = _this._options, tmp = _this__options.manifest, manifestOptions = tmp === void 0 ? {} : tmp;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/manifest",
3
- "version": "0.0.0-next-20240515125630",
3
+ "version": "0.0.0-next-20240516035452",
4
4
  "license": "MIT",
5
5
  "description": "Provide manifest/stats for webpack/rspack MF project .",
6
6
  "keywords": [
@@ -24,9 +24,9 @@
24
24
  "dependencies": {
25
25
  "find-pkg": "2.0.0",
26
26
  "chalk": "3.0.0",
27
- "@module-federation/sdk": "0.0.0-next-20240515125630",
28
- "@module-federation/dts-plugin": "0.0.0-next-20240515125630",
29
- "@module-federation/managers": "0.0.0-next-20240515125630"
27
+ "@module-federation/sdk": "0.0.0-next-20240516035452",
28
+ "@module-federation/dts-plugin": "0.0.0-next-20240516035452",
29
+ "@module-federation/managers": "0.0.0-next-20240516035452"
30
30
  },
31
31
  "exports": {
32
32
  ".": {