@module-federation/manifest 0.1.18 → 0.1.20

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
@@ -147,6 +147,24 @@ function _templateObject$2() {
147
147
  };
148
148
  return data;
149
149
  }
150
+ function isHotFile(file) {
151
+ return file.includes(HOT_UPDATE_SUFFIX);
152
+ }
153
+ var collectAssets = function(assets, jsTargetSet, cssTargetSet) {
154
+ assets.forEach(function(file) {
155
+ if (file.endsWith('.css')) {
156
+ cssTargetSet.add(file);
157
+ } else {
158
+ if (isDev()) {
159
+ if (!isHotFile(file)) {
160
+ jsTargetSet.add(file);
161
+ }
162
+ } else {
163
+ jsTargetSet.add(file);
164
+ }
165
+ }
166
+ });
167
+ };
150
168
  function getSharedModuleName(name) {
151
169
  var _name_split = _sliced_to_array$2(name.split(' '), 5); _name_split[0]; _name_split[1]; _name_split[2]; _name_split[3]; var sharedInfo = _name_split[4];
152
170
  return sharedInfo.split('@').slice(0, -1).join('@');
@@ -167,19 +185,7 @@ function getAssetsByChunkIDs(compilation, chunkIDMap) {
167
185
  return item.id === chunkID;
168
186
  });
169
187
  if (chunk) {
170
- _to_consumable_array(chunk.files).forEach(function(asset) {
171
- if (asset.endsWith('.css')) {
172
- assetMap[key].css.add(asset);
173
- } else {
174
- if (process.env['NODE_ENV'] === 'development') {
175
- if (!asset.includes(HOT_UPDATE_SUFFIX)) {
176
- assetMap[key].js.add(asset);
177
- }
178
- } else {
179
- assetMap[key].js.add(asset);
180
- }
181
- }
182
- });
188
+ collectAssets(_to_consumable_array(chunk.files), assetMap[key].js, assetMap[key].css);
183
189
  }
184
190
  });
185
191
  });
@@ -326,24 +332,12 @@ function getAssetsByChunk(chunk) {
326
332
  };
327
333
  var collectChunkFiles = function(targetChunk, type) {
328
334
  _to_consumable_array(targetChunk.groupsIterable).forEach(function(chunkGroup) {
329
- chunkGroup.getFiles().forEach(function(file) {
330
- if (file.endsWith('.css')) {
331
- assesSet.css[type].add(file);
332
- } else {
333
- assesSet.js[type].add(file);
334
- }
335
- });
335
+ collectAssets(chunkGroup.getFiles(), assesSet.js[type], assesSet.css[type]);
336
336
  });
337
337
  };
338
338
  collectChunkFiles(chunk, 'sync');
339
339
  _to_consumable_array(chunk.getAllAsyncChunks()).forEach(function(asyncChunk) {
340
- asyncChunk.files.forEach(function(file) {
341
- if (file.endsWith('.css')) {
342
- assesSet.css.async.add(file);
343
- } else {
344
- assesSet.js.async.add(file);
345
- }
346
- });
340
+ collectAssets(_to_consumable_array(asyncChunk.files), assesSet.js['async'], assesSet.css['async']);
347
341
  collectChunkFiles(asyncChunk, 'async');
348
342
  });
349
343
  var assets = {
@@ -1301,6 +1295,10 @@ function _tagged_template_literal(strings, raw) {
1301
1295
  }
1302
1296
  }));
1303
1297
  }
1298
+ function _type_of$1(obj) {
1299
+ "@swc/helpers - typeof";
1300
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
1301
+ }
1304
1302
  function _unsupported_iterable_to_array(o, minLen) {
1305
1303
  if (!o) return;
1306
1304
  if (typeof o === "string") return _array_like_to_array(o, minLen);
@@ -1624,7 +1622,7 @@ var StatsManager = /*#__PURE__*/ function() {
1624
1622
  remotes: [],
1625
1623
  exposes: []
1626
1624
  };
1627
- if (typeof manifestOptions === 'object' && manifestOptions.disableAssetsAnalyze) {
1625
+ if ((typeof manifestOptions === "undefined" ? "undefined" : _type_of$1(manifestOptions)) === 'object' && manifestOptions.disableAssetsAnalyze) {
1628
1626
  remotes = _this._remoteManager.statsRemoteWithEmptyUsedIn;
1629
1627
  stats.remotes = remotes;
1630
1628
  return [
@@ -1784,7 +1782,7 @@ var StatsManager = /*#__PURE__*/ function() {
1784
1782
  ];
1785
1783
  case 1:
1786
1784
  stats = _state.sent();
1787
- if (!(typeof manifestOptions === 'object' && manifestOptions.additionalData)) return [
1785
+ if (!((typeof manifestOptions === "undefined" ? "undefined" : _type_of$1(manifestOptions)) === 'object' && manifestOptions.additionalData)) return [
1788
1786
  3,
1789
1787
  3
1790
1788
  ];
@@ -1906,6 +1904,10 @@ function _instanceof(left, right) {
1906
1904
  return left instanceof right;
1907
1905
  }
1908
1906
  }
1907
+ function _type_of(obj) {
1908
+ "@swc/helpers - typeof";
1909
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
1910
+ }
1909
1911
  function _ts_generator(thisArg, body) {
1910
1912
  var f, y, t, g, _ = {
1911
1913
  label: 0,
@@ -2066,7 +2068,7 @@ var StatsPlugin = /*#__PURE__*/ function() {
2066
2068
  publicPath: _this1._statsManager.getPublicPath(compiler),
2067
2069
  compiler: compiler,
2068
2070
  bundler: _this1._bundler,
2069
- additionalData: typeof _this1._options.manifest === 'object' ? _this1._options.manifest.additionalData : undefined
2071
+ additionalData: _type_of(_this1._options.manifest) === 'object' ? _this1._options.manifest.additionalData : undefined
2070
2072
  });
2071
2073
  _state.label = 2;
2072
2074
  case 2:
package/dist/index.esm.js CHANGED
@@ -138,6 +138,24 @@ function _templateObject$2() {
138
138
  };
139
139
  return data;
140
140
  }
141
+ function isHotFile(file) {
142
+ return file.includes(HOT_UPDATE_SUFFIX);
143
+ }
144
+ var collectAssets = function(assets, jsTargetSet, cssTargetSet) {
145
+ assets.forEach(function(file) {
146
+ if (file.endsWith('.css')) {
147
+ cssTargetSet.add(file);
148
+ } else {
149
+ if (isDev()) {
150
+ if (!isHotFile(file)) {
151
+ jsTargetSet.add(file);
152
+ }
153
+ } else {
154
+ jsTargetSet.add(file);
155
+ }
156
+ }
157
+ });
158
+ };
141
159
  function getSharedModuleName(name) {
142
160
  var _name_split = _sliced_to_array$2(name.split(' '), 5); _name_split[0]; _name_split[1]; _name_split[2]; _name_split[3]; var sharedInfo = _name_split[4];
143
161
  return sharedInfo.split('@').slice(0, -1).join('@');
@@ -158,19 +176,7 @@ function getAssetsByChunkIDs(compilation, chunkIDMap) {
158
176
  return item.id === chunkID;
159
177
  });
160
178
  if (chunk) {
161
- _to_consumable_array(chunk.files).forEach(function(asset) {
162
- if (asset.endsWith('.css')) {
163
- assetMap[key].css.add(asset);
164
- } else {
165
- if (process.env['NODE_ENV'] === 'development') {
166
- if (!asset.includes(HOT_UPDATE_SUFFIX)) {
167
- assetMap[key].js.add(asset);
168
- }
169
- } else {
170
- assetMap[key].js.add(asset);
171
- }
172
- }
173
- });
179
+ collectAssets(_to_consumable_array(chunk.files), assetMap[key].js, assetMap[key].css);
174
180
  }
175
181
  });
176
182
  });
@@ -317,24 +323,12 @@ function getAssetsByChunk(chunk) {
317
323
  };
318
324
  var collectChunkFiles = function(targetChunk, type) {
319
325
  _to_consumable_array(targetChunk.groupsIterable).forEach(function(chunkGroup) {
320
- chunkGroup.getFiles().forEach(function(file) {
321
- if (file.endsWith('.css')) {
322
- assesSet.css[type].add(file);
323
- } else {
324
- assesSet.js[type].add(file);
325
- }
326
- });
326
+ collectAssets(chunkGroup.getFiles(), assesSet.js[type], assesSet.css[type]);
327
327
  });
328
328
  };
329
329
  collectChunkFiles(chunk, 'sync');
330
330
  _to_consumable_array(chunk.getAllAsyncChunks()).forEach(function(asyncChunk) {
331
- asyncChunk.files.forEach(function(file) {
332
- if (file.endsWith('.css')) {
333
- assesSet.css.async.add(file);
334
- } else {
335
- assesSet.js.async.add(file);
336
- }
337
- });
331
+ collectAssets(_to_consumable_array(asyncChunk.files), assesSet.js['async'], assesSet.css['async']);
338
332
  collectChunkFiles(asyncChunk, 'async');
339
333
  });
340
334
  var assets = {
@@ -1292,6 +1286,10 @@ function _tagged_template_literal(strings, raw) {
1292
1286
  }
1293
1287
  }));
1294
1288
  }
1289
+ function _type_of$1(obj) {
1290
+ "@swc/helpers - typeof";
1291
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
1292
+ }
1295
1293
  function _unsupported_iterable_to_array(o, minLen) {
1296
1294
  if (!o) return;
1297
1295
  if (typeof o === "string") return _array_like_to_array(o, minLen);
@@ -1615,7 +1613,7 @@ var StatsManager = /*#__PURE__*/ function() {
1615
1613
  remotes: [],
1616
1614
  exposes: []
1617
1615
  };
1618
- if (typeof manifestOptions === 'object' && manifestOptions.disableAssetsAnalyze) {
1616
+ if ((typeof manifestOptions === "undefined" ? "undefined" : _type_of$1(manifestOptions)) === 'object' && manifestOptions.disableAssetsAnalyze) {
1619
1617
  remotes = _this._remoteManager.statsRemoteWithEmptyUsedIn;
1620
1618
  stats.remotes = remotes;
1621
1619
  return [
@@ -1775,7 +1773,7 @@ var StatsManager = /*#__PURE__*/ function() {
1775
1773
  ];
1776
1774
  case 1:
1777
1775
  stats = _state.sent();
1778
- if (!(typeof manifestOptions === 'object' && manifestOptions.additionalData)) return [
1776
+ if (!((typeof manifestOptions === "undefined" ? "undefined" : _type_of$1(manifestOptions)) === 'object' && manifestOptions.additionalData)) return [
1779
1777
  3,
1780
1778
  3
1781
1779
  ];
@@ -1897,6 +1895,10 @@ function _instanceof(left, right) {
1897
1895
  return left instanceof right;
1898
1896
  }
1899
1897
  }
1898
+ function _type_of(obj) {
1899
+ "@swc/helpers - typeof";
1900
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
1901
+ }
1900
1902
  function _ts_generator(thisArg, body) {
1901
1903
  var f, y, t, g, _ = {
1902
1904
  label: 0,
@@ -2057,7 +2059,7 @@ var StatsPlugin = /*#__PURE__*/ function() {
2057
2059
  publicPath: _this1._statsManager.getPublicPath(compiler),
2058
2060
  compiler: compiler,
2059
2061
  bundler: _this1._bundler,
2060
- additionalData: typeof _this1._options.manifest === 'object' ? _this1._options.manifest.additionalData : undefined
2062
+ additionalData: _type_of(_this1._options.manifest) === 'object' ? _this1._options.manifest.additionalData : undefined
2061
2063
  });
2062
2064
  _state.label = 2;
2063
2065
  case 2:
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/manifest",
3
- "version": "0.1.18",
3
+ "version": "0.1.20",
4
4
  "license": "MIT",
5
5
  "description": "Provide manifest/stats for webpack/rspack MF project .",
6
6
  "keywords": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/manifest",
3
- "version": "0.1.18",
3
+ "version": "0.1.20",
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.1.18",
28
- "@module-federation/dts-plugin": "0.1.18",
29
- "@module-federation/managers": "0.1.18"
27
+ "@module-federation/sdk": "0.1.20",
28
+ "@module-federation/dts-plugin": "0.1.20",
29
+ "@module-federation/managers": "0.1.20"
30
30
  },
31
31
  "exports": {
32
32
  ".": {