@module-federation/manifest 0.8.8 → 0.8.10

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
@@ -364,7 +364,7 @@ function getFileName(manifestOptions) {
364
364
  manifestFileName: sdk.simpleJoinRemoteEntry(filePath, manifestFileName)
365
365
  };
366
366
  }
367
- function getTypesMetaInfo(pluginOptions, context) {
367
+ function getTypesMetaInfo(pluginOptions, context, compilation) {
368
368
  var defaultRemoteOptions = {
369
369
  generateAPITypes: true,
370
370
  compileInChildProcess: true
@@ -391,11 +391,29 @@ function getTypesMetaInfo(pluginOptions, context) {
391
391
  context: context,
392
392
  moduleFederationConfig: pluginOptions
393
393
  })), apiFileName = _retrieveTypesAssetsInfo.apiFileName, zipName = _retrieveTypesAssetsInfo.zipName, zipPrefix = _retrieveTypesAssetsInfo.zipPrefix;
394
+ var zip = path.join(zipPrefix, zipName);
395
+ var api = path.join(zipPrefix, apiFileName);
396
+ if (!zip || !compilation.getAsset(zip)) {
397
+ return {
398
+ path: '',
399
+ name: '',
400
+ zip: '',
401
+ api: ''
402
+ };
403
+ }
404
+ if (!api || !compilation.getAsset(api)) {
405
+ return {
406
+ path: '',
407
+ name: '',
408
+ zip: zip,
409
+ api: ''
410
+ };
411
+ }
394
412
  return {
395
413
  path: '',
396
414
  name: '',
397
- zip: path.join(zipPrefix, zipName),
398
- api: path.join(zipPrefix, apiFileName)
415
+ zip: zip,
416
+ api: api
399
417
  };
400
418
  } catch (err) {
401
419
  logger.warn("getTypesMetaInfo failed, it will use the default types meta info, and the errors as belows: ".concat(err));
@@ -1421,7 +1439,7 @@ var StatsManager = /*#__PURE__*/ function() {
1421
1439
  // same as the types supported by runtime, currently only global/var/script is supported
1422
1440
  type: ((_this__options = this._options) === null || _this__options === void 0 ? void 0 : (_this__options_library = _this__options.library) === null || _this__options_library === void 0 ? void 0 : _this__options_library.type) || 'global'
1423
1441
  },
1424
- types: getTypesMetaInfo(this._options, compiler.context),
1442
+ types: getTypesMetaInfo(this._options, compiler.context, compilation),
1425
1443
  globalName: globalName,
1426
1444
  pluginVersion: this._pluginVersion
1427
1445
  };
package/dist/index.esm.js CHANGED
@@ -362,7 +362,7 @@ function getFileName(manifestOptions) {
362
362
  manifestFileName: simpleJoinRemoteEntry(filePath, manifestFileName)
363
363
  };
364
364
  }
365
- function getTypesMetaInfo(pluginOptions, context) {
365
+ function getTypesMetaInfo(pluginOptions, context, compilation) {
366
366
  var defaultRemoteOptions = {
367
367
  generateAPITypes: true,
368
368
  compileInChildProcess: true
@@ -389,11 +389,29 @@ function getTypesMetaInfo(pluginOptions, context) {
389
389
  context: context,
390
390
  moduleFederationConfig: pluginOptions
391
391
  })), apiFileName = _retrieveTypesAssetsInfo.apiFileName, zipName = _retrieveTypesAssetsInfo.zipName, zipPrefix = _retrieveTypesAssetsInfo.zipPrefix;
392
+ var zip = path.join(zipPrefix, zipName);
393
+ var api = path.join(zipPrefix, apiFileName);
394
+ if (!zip || !compilation.getAsset(zip)) {
395
+ return {
396
+ path: '',
397
+ name: '',
398
+ zip: '',
399
+ api: ''
400
+ };
401
+ }
402
+ if (!api || !compilation.getAsset(api)) {
403
+ return {
404
+ path: '',
405
+ name: '',
406
+ zip: zip,
407
+ api: ''
408
+ };
409
+ }
392
410
  return {
393
411
  path: '',
394
412
  name: '',
395
- zip: path.join(zipPrefix, zipName),
396
- api: path.join(zipPrefix, apiFileName)
413
+ zip: zip,
414
+ api: api
397
415
  };
398
416
  } catch (err) {
399
417
  logger.warn("getTypesMetaInfo failed, it will use the default types meta info, and the errors as belows: ".concat(err));
@@ -1419,7 +1437,7 @@ var StatsManager = /*#__PURE__*/ function() {
1419
1437
  // same as the types supported by runtime, currently only global/var/script is supported
1420
1438
  type: ((_this__options = this._options) === null || _this__options === void 0 ? void 0 : (_this__options_library = _this__options.library) === null || _this__options_library === void 0 ? void 0 : _this__options_library.type) || 'global'
1421
1439
  },
1422
- types: getTypesMetaInfo(this._options, compiler.context),
1440
+ types: getTypesMetaInfo(this._options, compiler.context, compilation),
1423
1441
  globalName: globalName,
1424
1442
  pluginVersion: this._pluginVersion
1425
1443
  };
@@ -15,4 +15,4 @@ export declare function getFileName(manifestOptions?: moduleFederationPlugin.Mod
15
15
  statsFileName: string;
16
16
  manifestFileName: string;
17
17
  };
18
- export declare function getTypesMetaInfo(pluginOptions: moduleFederationPlugin.ModuleFederationPluginOptions, context: string): MetaDataTypes;
18
+ export declare function getTypesMetaInfo(pluginOptions: moduleFederationPlugin.ModuleFederationPluginOptions, context: string, compilation: Compilation): MetaDataTypes;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/manifest",
3
- "version": "0.8.8",
3
+ "version": "0.8.10",
4
4
  "license": "MIT",
5
5
  "description": "Provide manifest/stats for webpack/rspack MF project .",
6
6
  "keywords": [
@@ -29,9 +29,9 @@
29
29
  "dependencies": {
30
30
  "find-pkg": "2.0.0",
31
31
  "chalk": "3.0.0",
32
- "@module-federation/sdk": "0.8.8",
33
- "@module-federation/dts-plugin": "0.8.8",
34
- "@module-federation/managers": "0.8.8"
32
+ "@module-federation/sdk": "0.8.10",
33
+ "@module-federation/dts-plugin": "0.8.10",
34
+ "@module-federation/managers": "0.8.10"
35
35
  },
36
36
  "exports": {
37
37
  ".": {