@module-federation/manifest 0.1.12 → 0.1.13

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
@@ -13,8 +13,8 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
13
13
  var chalk__default = /*#__PURE__*/_interopDefaultLegacy(chalk);
14
14
  var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
15
15
 
16
- var PLUGIN_IDENTIFIER = "Module Federation Manifest Plugin";
17
- var HOT_UPDATE_SUFFIX = ".hot-update";
16
+ var PLUGIN_IDENTIFIER = 'Module Federation Manifest Plugin';
17
+ var HOT_UPDATE_SUFFIX = '.hot-update';
18
18
 
19
19
  function _array_like_to_array$2(arr, len) {
20
20
  if (len == null || len > arr.length) len = arr.length;
@@ -148,8 +148,8 @@ function _templateObject$2() {
148
148
  return data;
149
149
  }
150
150
  function getSharedModuleName(name) {
151
- 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
- return sharedInfo.split("@").slice(0, -1).join("@");
151
+ 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
+ return sharedInfo.split('@').slice(0, -1).join('@');
153
153
  }
154
154
  function getAssetsByChunkIDs(compilation, chunkIDMap) {
155
155
  var arrayChunks = Array.from(compilation.chunks);
@@ -168,10 +168,10 @@ function getAssetsByChunkIDs(compilation, chunkIDMap) {
168
168
  });
169
169
  if (chunk) {
170
170
  _to_consumable_array(chunk.files).forEach(function(asset) {
171
- if (asset.endsWith(".css")) {
171
+ if (asset.endsWith('.css')) {
172
172
  assetMap[key].css.add(asset);
173
173
  } else {
174
- if (process.env["NODE_ENV"] === "development") {
174
+ if (process.env['NODE_ENV'] === 'development') {
175
175
  if (!asset.includes(HOT_UPDATE_SUFFIX)) {
176
176
  assetMap[key].js.add(asset);
177
177
  }
@@ -327,7 +327,7 @@ function getAssetsByChunk(chunk) {
327
327
  var collectChunkFiles = function(targetChunk, type) {
328
328
  _to_consumable_array(targetChunk.groupsIterable).forEach(function(chunkGroup) {
329
329
  chunkGroup.getFiles().forEach(function(file) {
330
- if (file.endsWith(".css")) {
330
+ if (file.endsWith('.css')) {
331
331
  assesSet.css[type].add(file);
332
332
  } else {
333
333
  assesSet.js[type].add(file);
@@ -335,16 +335,16 @@ function getAssetsByChunk(chunk) {
335
335
  });
336
336
  });
337
337
  };
338
- collectChunkFiles(chunk, "sync");
338
+ collectChunkFiles(chunk, 'sync');
339
339
  _to_consumable_array(chunk.getAllAsyncChunks()).forEach(function(asyncChunk) {
340
340
  asyncChunk.files.forEach(function(file) {
341
- if (file.endsWith(".css")) {
341
+ if (file.endsWith('.css')) {
342
342
  assesSet.css.async.add(file);
343
343
  } else {
344
344
  assesSet.js.async.add(file);
345
345
  }
346
346
  });
347
- collectChunkFiles(asyncChunk, "async");
347
+ collectChunkFiles(asyncChunk, 'async');
348
348
  });
349
349
  var assets = {
350
350
  js: {
@@ -367,10 +367,10 @@ function error(msg) {
367
367
  throw new Error("[ ".concat(PLUGIN_IDENTIFIER, " ]: ").concat(msg));
368
368
  }
369
369
  function isDev() {
370
- return process.env["NODE_ENV"] === "development";
370
+ return process.env['NODE_ENV'] === 'development';
371
371
  }
372
372
  function getFileNameWithOutExt(str) {
373
- return str.replace(path__default["default"].extname(str), "");
373
+ return str.replace(path__default["default"].extname(str), '');
374
374
  }
375
375
  function getFileName(manifestOptions) {
376
376
  if (!manifestOptions) {
@@ -379,9 +379,9 @@ function getFileName(manifestOptions) {
379
379
  manifestFileName: sdk.ManifestFileName
380
380
  };
381
381
  }
382
- var filePath = typeof manifestOptions === "boolean" ? "" : manifestOptions.filePath || "";
383
- var fileName = typeof manifestOptions === "boolean" ? "" : manifestOptions.fileName || "";
384
- var JSON_EXT = ".json";
382
+ var filePath = typeof manifestOptions === 'boolean' ? '' : manifestOptions.filePath || '';
383
+ var fileName = typeof manifestOptions === 'boolean' ? '' : manifestOptions.fileName || '';
384
+ var JSON_EXT = '.json';
385
385
  var addExt = function(name) {
386
386
  if (name.endsWith(JSON_EXT)) {
387
387
  return name;
@@ -392,7 +392,7 @@ function getFileName(manifestOptions) {
392
392
  return name.replace(JSON_EXT, "".concat(suffix).concat(JSON_EXT));
393
393
  };
394
394
  var manifestFileName = fileName ? addExt(fileName) : sdk.ManifestFileName;
395
- var statsFileName = fileName ? insertSuffix(manifestFileName, "-stats") : sdk.StatsFileName;
395
+ var statsFileName = fileName ? insertSuffix(manifestFileName, '-stats') : sdk.StatsFileName;
396
396
  return {
397
397
  statsFileName: sdk.simpleJoinRemoteEntry(filePath, statsFileName),
398
398
  manifestFileName: sdk.simpleJoinRemoteEntry(filePath, manifestFileName)
@@ -404,20 +404,20 @@ function getTypesMetaInfo(pluginOptions, context) {
404
404
  compileInChildProcess: true
405
405
  };
406
406
  var defaultTypesMetaInfo = {
407
- path: "",
408
- name: "",
409
- zip: "",
410
- api: ""
407
+ path: '',
408
+ name: '',
409
+ zip: '',
410
+ api: ''
411
411
  };
412
412
  try {
413
413
  var normalizedDtsOptions = sdk.normalizeOptions(core.isTSProject(pluginOptions.dts, context), {
414
414
  generateTypes: defaultRemoteOptions,
415
415
  consumeTypes: {}
416
- }, "mfOptions.dts")(pluginOptions.dts);
416
+ }, 'mfOptions.dts')(pluginOptions.dts);
417
417
  if (normalizedDtsOptions === false) {
418
418
  return defaultTypesMetaInfo;
419
419
  }
420
- var normalizedRemote = sdk.normalizeOptions(true, defaultRemoteOptions, "mfOptions.dts.generateTypes")(normalizedDtsOptions.generateTypes);
420
+ var normalizedRemote = sdk.normalizeOptions(true, defaultRemoteOptions, 'mfOptions.dts.generateTypes')(normalizedDtsOptions.generateTypes);
421
421
  if (normalizedRemote === false) {
422
422
  return defaultTypesMetaInfo;
423
423
  }
@@ -426,8 +426,8 @@ function getTypesMetaInfo(pluginOptions, context) {
426
426
  moduleFederationConfig: pluginOptions
427
427
  })), apiFileName = _retrieveTypesAssetsInfo.apiFileName, zipName = _retrieveTypesAssetsInfo.zipName;
428
428
  return {
429
- path: "",
430
- name: "",
429
+ path: '',
430
+ name: '',
431
431
  zip: zipName,
432
432
  api: apiFileName
433
433
  };
@@ -699,10 +699,10 @@ var ManifestManager = /*#__PURE__*/ function() {
699
699
  moduleName: statsRemote.moduleName,
700
700
  alias: statsRemote.alias
701
701
  };
702
- if ("entry" in statsRemote) {
702
+ if ('entry' in statsRemote) {
703
703
  // @ts-ignore
704
704
  remote.entry = statsRemote.entry;
705
- } else if ("version" in statsRemote) {
705
+ } else if ('version' in statsRemote) {
706
706
  // @ts-ignore
707
707
  remote.entry = statsRemote.version;
708
708
  }
@@ -733,7 +733,7 @@ var ManifestManager = /*#__PURE__*/ function() {
733
733
  case 2:
734
734
  compilation.emitAsset(manifestFileName, new compiler.webpack.sources.RawSource(JSON.stringify(_this._manifest, null, 2)));
735
735
  if (isDev()) {
736
- console.log(chalk__default["default"](_templateObject$1(), PLUGIN_IDENTIFIER, publicPath, manifestFileName));
736
+ console.log(chalk__default["default"](_templateObject$1(), PLUGIN_IDENTIFIER, publicPath === 'auto' ? '{auto}/' : publicPath, manifestFileName));
737
737
  }
738
738
  return [
739
739
  2
@@ -869,7 +869,7 @@ var ModuleHandler = /*#__PURE__*/ function() {
869
869
  var bundler = param.bundler;
870
870
  _class_call_check$2(this, ModuleHandler);
871
871
  _define_property$2(this, "_options", void 0);
872
- _define_property$2(this, "_bundler", "webpack");
872
+ _define_property$2(this, "_bundler", 'webpack');
873
873
  _define_property$2(this, "_modules", void 0);
874
874
  _define_property$2(this, "_remoteManager", new managers.RemoteManager());
875
875
  _define_property$2(this, "_sharedManager", new managers.SharedManager());
@@ -885,7 +885,7 @@ var ModuleHandler = /*#__PURE__*/ function() {
885
885
  {
886
886
  key: "isRspack",
887
887
  get: function get() {
888
- return this._bundler === "rspack";
888
+ return this._bundler === 'rspack';
889
889
  }
890
890
  },
891
891
  {
@@ -948,27 +948,27 @@ var ModuleHandler = /*#__PURE__*/ function() {
948
948
  }
949
949
  };
950
950
  var parseResolvedIdentifier = function(nameAndVersion) {
951
- var name = "";
952
- var version = "";
953
- if (nameAndVersion.startsWith("@")) {
954
- var splitInfo = nameAndVersion.split("@");
955
- splitInfo[0] = "@";
951
+ var name = '';
952
+ var version = '';
953
+ if (nameAndVersion.startsWith('@')) {
954
+ var splitInfo = nameAndVersion.split('@');
955
+ splitInfo[0] = '@';
956
956
  name = splitInfo[0] + splitInfo[1];
957
957
  version = splitInfo[2];
958
- } else if (nameAndVersion.includes("@")) {
958
+ } else if (nameAndVersion.includes('@')) {
959
959
  var ref;
960
- ref = _sliced_to_array$1(nameAndVersion.split("@"), 2), name = ref[0], version = ref[1];
961
- version = version.replace(/[\^~>|>=]/g, "");
960
+ ref = _sliced_to_array$1(nameAndVersion.split('@'), 2), name = ref[0], version = ref[1];
961
+ version = version.replace(/[\^~>|>=]/g, '');
962
962
  }
963
963
  return {
964
964
  name: name,
965
965
  version: version
966
966
  };
967
967
  };
968
- if (moduleType === "provide-module") {
968
+ if (moduleType === 'provide-module') {
969
969
  // identifier(rspack) = provide shared module (default) react@18.2.0 = /temp/node_modules/.pnpm/react@18.2.0/node_modules/react/index.js
970
970
  // identifier(webpack) = provide module (default) react@18.2.0 = /temp/node_modules/.pnpm/react@18.2.0/node_modules/react/index.js
971
- var data = identifier.split(" ");
971
+ var data = identifier.split(' ');
972
972
  var nameAndVersion = this.isRspack ? data[4] : data[3];
973
973
  var _parseResolvedIdentifier = parseResolvedIdentifier(nameAndVersion), name = _parseResolvedIdentifier.name, version = _parseResolvedIdentifier.version;
974
974
  if (name && version) {
@@ -976,13 +976,13 @@ var ModuleHandler = /*#__PURE__*/ function() {
976
976
  collectRelationshipMap(mod, name);
977
977
  }
978
978
  }
979
- if (moduleType === "consume-shared-module") {
979
+ if (moduleType === 'consume-shared-module') {
980
980
  // identifier(rspack) = consume shared module (default) lodash/get@^4.17.21 (strict) (fallback: /temp/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/get.js)
981
981
  // identifier(webpack) = consume-shared-module|default|react-dom|!=1.8...2...0|false|/temp/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/index.js|true|false
982
- var SEPARATOR = this.isRspack ? " " : "|";
982
+ var SEPARATOR = this.isRspack ? ' ' : '|';
983
983
  var data1 = identifier.split(SEPARATOR);
984
- var pkgName = "";
985
- var pkgVersion = "";
984
+ var pkgName = '';
985
+ var pkgVersion = '';
986
986
  if (this.isRspack) {
987
987
  var nameAndVersion1 = data1[4];
988
988
  var res = parseResolvedIdentifier(nameAndVersion1);
@@ -991,14 +991,14 @@ var ModuleHandler = /*#__PURE__*/ function() {
991
991
  } else {
992
992
  pkgName = data1[2];
993
993
  var pkgVersionRange = data1[3];
994
- pkgVersion = "";
995
- if (pkgVersionRange.startsWith("=")) {
996
- pkgVersion = data1[3].replace("=", "");
994
+ pkgVersion = '';
995
+ if (pkgVersionRange.startsWith('=')) {
996
+ pkgVersion = data1[3].replace('=', '');
997
997
  } else {
998
998
  if (sharedManagerNormalizedOptions[pkgName]) {
999
999
  pkgVersion = sharedManagerNormalizedOptions[pkgName].version;
1000
1000
  } else {
1001
- var fullPkgName = pkgName.split("/").slice(0, -1).join("/");
1001
+ var fullPkgName = pkgName.split('/').slice(0, -1).join('/');
1002
1002
  // pkgName: react-dom/
1003
1003
  if (sharedManagerNormalizedOptions["".concat(fullPkgName, "/")]) {
1004
1004
  if (sharedManagerNormalizedOptions[fullPkgName]) {
@@ -1027,14 +1027,14 @@ var ModuleHandler = /*#__PURE__*/ function() {
1027
1027
  }
1028
1028
  var remoteManagerNormalizedOptions = this._remoteManager.normalizedOptions;
1029
1029
  // identifier = remote (default) webpack/container/reference/app2 ./Button
1030
- var data = identifier.split(" ");
1030
+ var data = identifier.split(' ');
1031
1031
  if (data.length === 4) {
1032
- var moduleName = data[3].replace("./", "");
1033
- var remoteAlias = data[2].replace("webpack/container/reference/", "");
1032
+ var moduleName = data[3].replace('./', '');
1033
+ var remoteAlias = data[2].replace('webpack/container/reference/', '');
1034
1034
  var normalizedRemote = remoteManagerNormalizedOptions[remoteAlias];
1035
1035
  var basicRemote = {
1036
1036
  alias: normalizedRemote.alias,
1037
- consumingFederationContainerName: this._options.name || "",
1037
+ consumingFederationContainerName: this._options.name || '',
1038
1038
  federationContainerName: remoteManagerNormalizedOptions[remoteAlias].name,
1039
1039
  moduleName: moduleName,
1040
1040
  // @ts-ignore to deduplicate
@@ -1044,7 +1044,7 @@ var ModuleHandler = /*#__PURE__*/ function() {
1044
1044
  return;
1045
1045
  }
1046
1046
  var remote;
1047
- if ("version" in normalizedRemote) {
1047
+ if ('version' in normalizedRemote) {
1048
1048
  remote = _object_spread_props$1(_object_spread$1({}, basicRemote), {
1049
1049
  version: normalizedRemote.version
1050
1050
  });
@@ -1062,7 +1062,7 @@ var ModuleHandler = /*#__PURE__*/ function() {
1062
1062
  var exposeModName = _this.isRspack ? moduleName : resolvedModule;
1063
1063
  if (userRequest && exposeModName && remotesConsumerMap[userRequest]) {
1064
1064
  // @ts-ignore to deduplicate
1065
- remotesConsumerMap[userRequest].usedIn.add(exposeModName.replace("./", ""));
1065
+ remotesConsumerMap[userRequest].usedIn.add(exposeModName.replace('./', ''));
1066
1066
  }
1067
1067
  });
1068
1068
  }
@@ -1077,10 +1077,10 @@ var ModuleHandler = /*#__PURE__*/ function() {
1077
1077
  return;
1078
1078
  }
1079
1079
  // identifier: container entry (default) [[".",{"import":["./src/routes/page.tsx"],"name":"__federation_expose_default_export"}]]'
1080
- var data = identifier.split(" ");
1080
+ var data = identifier.split(' ');
1081
1081
  JSON.parse(data[3]).forEach(function(param) {
1082
1082
  var _param = _sliced_to_array$1(param, 2), prefixedName = _param[0], file = _param[1];
1083
- var exposeModuleName = prefixedName.replace("./", "");
1083
+ var exposeModuleName = prefixedName.replace('./', '');
1084
1084
  // TODO: support multiple import
1085
1085
  exposesMap[getFileNameWithOutExt(file.import[0])] = {
1086
1086
  path: prefixedName,
@@ -1113,17 +1113,17 @@ var ModuleHandler = /*#__PURE__*/ function() {
1113
1113
  var sharedMap = {};
1114
1114
  var isSharedModule = function(moduleType) {
1115
1115
  return Boolean(moduleType && [
1116
- "provide-module",
1117
- "consume-shared-module"
1116
+ 'provide-module',
1117
+ 'consume-shared-module'
1118
1118
  ].includes(moduleType));
1119
1119
  };
1120
1120
  var isContainerModule = function(identifier) {
1121
- var data = identifier.split(" ");
1122
- return Boolean(data[0] === "container" && data[1] === "entry");
1121
+ var data = identifier.split(' ');
1122
+ return Boolean(data[0] === 'container' && data[1] === 'entry');
1123
1123
  };
1124
1124
  var isRemoteModule = function(identifier) {
1125
- var data = identifier.split(" ");
1126
- return data[0] === "remote";
1125
+ var data = identifier.split(' ');
1126
+ return data[0] === 'remote';
1127
1127
  };
1128
1128
  // handle remote/expose
1129
1129
  this._modules.forEach(function(mod) {
@@ -1415,8 +1415,8 @@ function _templateObject() {
1415
1415
  }
1416
1416
  function _templateObject1() {
1417
1417
  var data = _tagged_template_literal([
1418
- "{bold {yellow [ ",
1419
- " ]: Manifest will not generate, because publicPath can only be absolute path, but got '",
1418
+ "{bold {blue [ ",
1419
+ " ]: Manifest will use absolute path resolution via its host at runtime, reason: publicPath='",
1420
1420
  "'}}"
1421
1421
  ]);
1422
1422
  _templateObject1 = function _templateObject() {
@@ -1430,7 +1430,7 @@ var StatsManager = /*#__PURE__*/ function() {
1430
1430
  _define_property$1(this, "_options", {});
1431
1431
  _define_property$1(this, "_publicPath", void 0);
1432
1432
  _define_property$1(this, "_pluginVersion", void 0);
1433
- _define_property$1(this, "_bundler", "webpack");
1433
+ _define_property$1(this, "_bundler", 'webpack');
1434
1434
  _define_property$1(this, "_containerManager", new managers.ContainerManager());
1435
1435
  _define_property$1(this, "_remoteManager", new managers.RemoteManager());
1436
1436
  _define_property$1(this, "_sharedManager", new managers.SharedManager());
@@ -1443,7 +1443,7 @@ var StatsManager = /*#__PURE__*/ function() {
1443
1443
  var pkg = this._pkgJsonManager.readPKGJson(process.cwd());
1444
1444
  return {
1445
1445
  buildVersion: managers.utils.getBuildVersion(),
1446
- buildName: managers.utils.getBuildName() || pkg["name"]
1446
+ buildName: managers.utils.getBuildName() || pkg['name']
1447
1447
  };
1448
1448
  }
1449
1449
  },
@@ -1462,32 +1462,32 @@ var StatsManager = /*#__PURE__*/ function() {
1462
1462
  var type = this._pkgJsonManager.getExposeGarfishModuleType(context || process.cwd());
1463
1463
  var getRemoteEntryName = function() {
1464
1464
  if (!_this._containerManager.enable) {
1465
- return "";
1465
+ return '';
1466
1466
  }
1467
- assert(name, "name is required");
1467
+ assert(name, 'name is required');
1468
1468
  var remoteEntryPoint = compilation.entrypoints.get(name);
1469
- assert(remoteEntryPoint, "Can not get remoteEntry entryPoint!");
1469
+ assert(remoteEntryPoint, 'Can not get remoteEntry entryPoint!');
1470
1470
  var remoteEntryNameChunk = compilation.namedChunks.get(name);
1471
- assert(remoteEntryNameChunk, "Can not get remoteEntry chunk!");
1471
+ assert(remoteEntryNameChunk, 'Can not get remoteEntry chunk!');
1472
1472
  var files = Array.from(remoteEntryNameChunk.files).filter(function(f) {
1473
- return !f.includes(HOT_UPDATE_SUFFIX);
1473
+ return !f.includes(HOT_UPDATE_SUFFIX) && !f.endsWith('.css');
1474
1474
  });
1475
- assert(files.length === 1, "remoteEntry chunk should not have multiple files!, current files: ".concat(files.join(",")));
1475
+ assert(files.length === 1, "remoteEntry chunk should not have multiple files!, current files: ".concat(files.join(',')));
1476
1476
  var remoteEntryName = files[0];
1477
1477
  return remoteEntryName;
1478
1478
  };
1479
1479
  var globalName = this._containerManager.globalEntryName;
1480
1480
  assert(globalName, 'Can not get library.name, please ensure you have set library.name and the type is "string" !');
1481
- assert(this._pluginVersion, "Can not get pluginVersion, please ensure you have set pluginVersion !");
1481
+ assert(this._pluginVersion, 'Can not get pluginVersion, please ensure you have set pluginVersion !');
1482
1482
  var metaData = {
1483
1483
  name: name,
1484
1484
  type: type,
1485
1485
  buildInfo: buildInfo,
1486
1486
  remoteEntry: {
1487
1487
  name: getRemoteEntryName(),
1488
- path: "",
1488
+ path: '',
1489
1489
  // same as the types supported by runtime, currently only global/var/script is supported
1490
- type: "global"
1490
+ type: 'global'
1491
1491
  },
1492
1492
  types: getTypesMetaInfo(this._options, compiler.context),
1493
1493
  globalName: globalName,
@@ -1506,10 +1506,10 @@ var StatsManager = /*#__PURE__*/ function() {
1506
1506
  return false;
1507
1507
  }
1508
1508
  var array = [
1509
- module.name.includes("container entry"),
1510
- module.name.includes("remote "),
1511
- module.name.includes("shared module "),
1512
- module.name.includes("provide module ")
1509
+ module.name.includes('container entry'),
1510
+ module.name.includes('remote '),
1511
+ module.name.includes('shared module '),
1512
+ module.name.includes('provide module ')
1513
1513
  ];
1514
1514
  return array.some(function(item) {
1515
1515
  return item;
@@ -1525,7 +1525,7 @@ var StatsManager = /*#__PURE__*/ function() {
1525
1525
  var exposeFileNameImportMap = this._containerManager.exposeFileNameImportMap;
1526
1526
  var assets = {};
1527
1527
  chunks.forEach(function(chunk) {
1528
- if (typeof chunk.name === "string" && exposeFileNameImportMap[chunk.name]) {
1528
+ if (typeof chunk.name === 'string' && exposeFileNameImportMap[chunk.name]) {
1529
1529
  // TODO: support multiple import
1530
1530
  var exposeKey = exposeFileNameImportMap[chunk.name][0];
1531
1531
  assets[getFileNameWithOutExt(exposeKey)] = getAssetsByChunk(chunk);
@@ -1542,7 +1542,7 @@ var StatsManager = /*#__PURE__*/ function() {
1542
1542
  return false;
1543
1543
  }
1544
1544
  var array = [
1545
- module.name.includes("consume shared module ")
1545
+ module.name.includes('consume shared module ')
1546
1546
  ];
1547
1547
  return array.some(function(item) {
1548
1548
  return item;
@@ -1621,7 +1621,7 @@ var StatsManager = /*#__PURE__*/ function() {
1621
1621
  remotes: [],
1622
1622
  exposes: []
1623
1623
  };
1624
- if (typeof manifestOptions === "object" && manifestOptions.disableAssetsAnalyze) {
1624
+ if (typeof manifestOptions === 'object' && manifestOptions.disableAssetsAnalyze) {
1625
1625
  remotes = _this._remoteManager.statsRemoteWithEmptyUsedIn;
1626
1626
  stats.remotes = remotes;
1627
1627
  return [
@@ -1642,9 +1642,9 @@ var StatsManager = /*#__PURE__*/ function() {
1642
1642
  chunks: false,
1643
1643
  reasons: true
1644
1644
  };
1645
- if (_this._bundler === "webpack") {
1646
- statsOptions["cached"] = true;
1647
- statsOptions["cachedModules"] = true;
1645
+ if (_this._bundler === 'webpack') {
1646
+ statsOptions['cached'] = true;
1647
+ statsOptions['cachedModules'] = true;
1648
1648
  }
1649
1649
  webpackStats = liveStats.toJson(statsOptions);
1650
1650
  filteredModules = _this._getFilteredModules(webpackStats);
@@ -1781,7 +1781,7 @@ var StatsManager = /*#__PURE__*/ function() {
1781
1781
  ];
1782
1782
  case 1:
1783
1783
  stats = _state.sent();
1784
- if (!(typeof manifestOptions === "object" && manifestOptions.additionalData)) return [
1784
+ if (!(typeof manifestOptions === 'object' && manifestOptions.additionalData)) return [
1785
1785
  3,
1786
1786
  3
1787
1787
  ];
@@ -1821,12 +1821,12 @@ var StatsManager = /*#__PURE__*/ function() {
1821
1821
  key: "validate",
1822
1822
  value: function validate(compiler) {
1823
1823
  var _compiler_options = compiler.options, publicPath = _compiler_options.output.publicPath;
1824
- if (typeof publicPath !== "string") {
1824
+ if (typeof publicPath !== 'string') {
1825
1825
  console.warn(chalk__default["default"](_templateObject(), PLUGIN_IDENTIFIER, publicPath));
1826
1826
  return false;
1827
- } else if (publicPath === "auto") {
1827
+ } else if (publicPath === 'auto') {
1828
1828
  console.warn(chalk__default["default"](_templateObject1(), PLUGIN_IDENTIFIER, publicPath));
1829
- return false;
1829
+ return true;
1830
1830
  }
1831
1831
  return true;
1832
1832
  }
@@ -2002,12 +2002,12 @@ var StatsPlugin = /*#__PURE__*/ function() {
2002
2002
  function StatsPlugin(options, param) {
2003
2003
  var pluginVersion = param.pluginVersion, bundler = param.bundler;
2004
2004
  _class_call_check(this, StatsPlugin);
2005
- _define_property(this, "name", "StatsPlugin");
2005
+ _define_property(this, "name", 'StatsPlugin');
2006
2006
  _define_property(this, "_options", {});
2007
2007
  _define_property(this, "_statsManager", new StatsManager());
2008
2008
  _define_property(this, "_manifestManager", new ManifestManager());
2009
2009
  _define_property(this, "_enable", true);
2010
- _define_property(this, "_bundler", "webpack");
2010
+ _define_property(this, "_bundler", 'webpack');
2011
2011
  try {
2012
2012
  this._options = options;
2013
2013
  this._bundler = bundler;
@@ -2036,10 +2036,10 @@ var StatsPlugin = /*#__PURE__*/ function() {
2036
2036
  if (!res) {
2037
2037
  return;
2038
2038
  }
2039
- compiler.hooks.thisCompilation.tap("generateStats", function(compilation) {
2039
+ compiler.hooks.thisCompilation.tap('generateStats', function(compilation) {
2040
2040
  var _this1 = _this;
2041
2041
  compilation.hooks.processAssets.tapPromise({
2042
- name: "generateStats",
2042
+ name: 'generateStats',
2043
2043
  // @ts-ignore use runtime variable in case peer dep not installed
2044
2044
  stage: compilation.constructor.PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER
2045
2045
  }, /*#__PURE__*/ _async_to_generator(function() {
@@ -2063,7 +2063,7 @@ var StatsPlugin = /*#__PURE__*/ function() {
2063
2063
  publicPath: _this1._statsManager.getPublicPath(compiler),
2064
2064
  compiler: compiler,
2065
2065
  bundler: _this1._bundler,
2066
- additionalData: typeof _this1._options.manifest === "object" ? _this1._options.manifest.additionalData : undefined
2066
+ additionalData: typeof _this1._options.manifest === 'object' ? _this1._options.manifest.additionalData : undefined
2067
2067
  });
2068
2068
  _state.label = 2;
2069
2069
  case 2:
package/dist/index.esm.js CHANGED
@@ -4,8 +4,8 @@ import { StatsFileName, ManifestFileName, simpleJoinRemoteEntry, normalizeOption
4
4
  import { isTSProject, retrieveTypesAssetsInfo } from '@module-federation/dts-plugin/core';
5
5
  import { RemoteManager, SharedManager, ContainerManager, PKGJsonManager, utils } from '@module-federation/managers';
6
6
 
7
- var PLUGIN_IDENTIFIER = "Module Federation Manifest Plugin";
8
- var HOT_UPDATE_SUFFIX = ".hot-update";
7
+ var PLUGIN_IDENTIFIER = 'Module Federation Manifest Plugin';
8
+ var HOT_UPDATE_SUFFIX = '.hot-update';
9
9
 
10
10
  function _array_like_to_array$2(arr, len) {
11
11
  if (len == null || len > arr.length) len = arr.length;
@@ -139,8 +139,8 @@ function _templateObject$2() {
139
139
  return data;
140
140
  }
141
141
  function getSharedModuleName(name) {
142
- 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
- return sharedInfo.split("@").slice(0, -1).join("@");
142
+ 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
+ return sharedInfo.split('@').slice(0, -1).join('@');
144
144
  }
145
145
  function getAssetsByChunkIDs(compilation, chunkIDMap) {
146
146
  var arrayChunks = Array.from(compilation.chunks);
@@ -159,10 +159,10 @@ function getAssetsByChunkIDs(compilation, chunkIDMap) {
159
159
  });
160
160
  if (chunk) {
161
161
  _to_consumable_array(chunk.files).forEach(function(asset) {
162
- if (asset.endsWith(".css")) {
162
+ if (asset.endsWith('.css')) {
163
163
  assetMap[key].css.add(asset);
164
164
  } else {
165
- if (process.env["NODE_ENV"] === "development") {
165
+ if (process.env['NODE_ENV'] === 'development') {
166
166
  if (!asset.includes(HOT_UPDATE_SUFFIX)) {
167
167
  assetMap[key].js.add(asset);
168
168
  }
@@ -318,7 +318,7 @@ function getAssetsByChunk(chunk) {
318
318
  var collectChunkFiles = function(targetChunk, type) {
319
319
  _to_consumable_array(targetChunk.groupsIterable).forEach(function(chunkGroup) {
320
320
  chunkGroup.getFiles().forEach(function(file) {
321
- if (file.endsWith(".css")) {
321
+ if (file.endsWith('.css')) {
322
322
  assesSet.css[type].add(file);
323
323
  } else {
324
324
  assesSet.js[type].add(file);
@@ -326,16 +326,16 @@ function getAssetsByChunk(chunk) {
326
326
  });
327
327
  });
328
328
  };
329
- collectChunkFiles(chunk, "sync");
329
+ collectChunkFiles(chunk, 'sync');
330
330
  _to_consumable_array(chunk.getAllAsyncChunks()).forEach(function(asyncChunk) {
331
331
  asyncChunk.files.forEach(function(file) {
332
- if (file.endsWith(".css")) {
332
+ if (file.endsWith('.css')) {
333
333
  assesSet.css.async.add(file);
334
334
  } else {
335
335
  assesSet.js.async.add(file);
336
336
  }
337
337
  });
338
- collectChunkFiles(asyncChunk, "async");
338
+ collectChunkFiles(asyncChunk, 'async');
339
339
  });
340
340
  var assets = {
341
341
  js: {
@@ -358,10 +358,10 @@ function error(msg) {
358
358
  throw new Error("[ ".concat(PLUGIN_IDENTIFIER, " ]: ").concat(msg));
359
359
  }
360
360
  function isDev() {
361
- return process.env["NODE_ENV"] === "development";
361
+ return process.env['NODE_ENV'] === 'development';
362
362
  }
363
363
  function getFileNameWithOutExt(str) {
364
- return str.replace(path.extname(str), "");
364
+ return str.replace(path.extname(str), '');
365
365
  }
366
366
  function getFileName(manifestOptions) {
367
367
  if (!manifestOptions) {
@@ -370,9 +370,9 @@ function getFileName(manifestOptions) {
370
370
  manifestFileName: ManifestFileName
371
371
  };
372
372
  }
373
- var filePath = typeof manifestOptions === "boolean" ? "" : manifestOptions.filePath || "";
374
- var fileName = typeof manifestOptions === "boolean" ? "" : manifestOptions.fileName || "";
375
- var JSON_EXT = ".json";
373
+ var filePath = typeof manifestOptions === 'boolean' ? '' : manifestOptions.filePath || '';
374
+ var fileName = typeof manifestOptions === 'boolean' ? '' : manifestOptions.fileName || '';
375
+ var JSON_EXT = '.json';
376
376
  var addExt = function(name) {
377
377
  if (name.endsWith(JSON_EXT)) {
378
378
  return name;
@@ -383,7 +383,7 @@ function getFileName(manifestOptions) {
383
383
  return name.replace(JSON_EXT, "".concat(suffix).concat(JSON_EXT));
384
384
  };
385
385
  var manifestFileName = fileName ? addExt(fileName) : ManifestFileName;
386
- var statsFileName = fileName ? insertSuffix(manifestFileName, "-stats") : StatsFileName;
386
+ var statsFileName = fileName ? insertSuffix(manifestFileName, '-stats') : StatsFileName;
387
387
  return {
388
388
  statsFileName: simpleJoinRemoteEntry(filePath, statsFileName),
389
389
  manifestFileName: simpleJoinRemoteEntry(filePath, manifestFileName)
@@ -395,20 +395,20 @@ function getTypesMetaInfo(pluginOptions, context) {
395
395
  compileInChildProcess: true
396
396
  };
397
397
  var defaultTypesMetaInfo = {
398
- path: "",
399
- name: "",
400
- zip: "",
401
- api: ""
398
+ path: '',
399
+ name: '',
400
+ zip: '',
401
+ api: ''
402
402
  };
403
403
  try {
404
404
  var normalizedDtsOptions = normalizeOptions(isTSProject(pluginOptions.dts, context), {
405
405
  generateTypes: defaultRemoteOptions,
406
406
  consumeTypes: {}
407
- }, "mfOptions.dts")(pluginOptions.dts);
407
+ }, 'mfOptions.dts')(pluginOptions.dts);
408
408
  if (normalizedDtsOptions === false) {
409
409
  return defaultTypesMetaInfo;
410
410
  }
411
- var normalizedRemote = normalizeOptions(true, defaultRemoteOptions, "mfOptions.dts.generateTypes")(normalizedDtsOptions.generateTypes);
411
+ var normalizedRemote = normalizeOptions(true, defaultRemoteOptions, 'mfOptions.dts.generateTypes')(normalizedDtsOptions.generateTypes);
412
412
  if (normalizedRemote === false) {
413
413
  return defaultTypesMetaInfo;
414
414
  }
@@ -417,8 +417,8 @@ function getTypesMetaInfo(pluginOptions, context) {
417
417
  moduleFederationConfig: pluginOptions
418
418
  })), apiFileName = _retrieveTypesAssetsInfo.apiFileName, zipName = _retrieveTypesAssetsInfo.zipName;
419
419
  return {
420
- path: "",
421
- name: "",
420
+ path: '',
421
+ name: '',
422
422
  zip: zipName,
423
423
  api: apiFileName
424
424
  };
@@ -690,10 +690,10 @@ var ManifestManager = /*#__PURE__*/ function() {
690
690
  moduleName: statsRemote.moduleName,
691
691
  alias: statsRemote.alias
692
692
  };
693
- if ("entry" in statsRemote) {
693
+ if ('entry' in statsRemote) {
694
694
  // @ts-ignore
695
695
  remote.entry = statsRemote.entry;
696
- } else if ("version" in statsRemote) {
696
+ } else if ('version' in statsRemote) {
697
697
  // @ts-ignore
698
698
  remote.entry = statsRemote.version;
699
699
  }
@@ -724,7 +724,7 @@ var ManifestManager = /*#__PURE__*/ function() {
724
724
  case 2:
725
725
  compilation.emitAsset(manifestFileName, new compiler.webpack.sources.RawSource(JSON.stringify(_this._manifest, null, 2)));
726
726
  if (isDev()) {
727
- console.log(chalk(_templateObject$1(), PLUGIN_IDENTIFIER, publicPath, manifestFileName));
727
+ console.log(chalk(_templateObject$1(), PLUGIN_IDENTIFIER, publicPath === 'auto' ? '{auto}/' : publicPath, manifestFileName));
728
728
  }
729
729
  return [
730
730
  2
@@ -860,7 +860,7 @@ var ModuleHandler = /*#__PURE__*/ function() {
860
860
  var bundler = param.bundler;
861
861
  _class_call_check$2(this, ModuleHandler);
862
862
  _define_property$2(this, "_options", void 0);
863
- _define_property$2(this, "_bundler", "webpack");
863
+ _define_property$2(this, "_bundler", 'webpack');
864
864
  _define_property$2(this, "_modules", void 0);
865
865
  _define_property$2(this, "_remoteManager", new RemoteManager());
866
866
  _define_property$2(this, "_sharedManager", new SharedManager());
@@ -876,7 +876,7 @@ var ModuleHandler = /*#__PURE__*/ function() {
876
876
  {
877
877
  key: "isRspack",
878
878
  get: function get() {
879
- return this._bundler === "rspack";
879
+ return this._bundler === 'rspack';
880
880
  }
881
881
  },
882
882
  {
@@ -939,27 +939,27 @@ var ModuleHandler = /*#__PURE__*/ function() {
939
939
  }
940
940
  };
941
941
  var parseResolvedIdentifier = function(nameAndVersion) {
942
- var name = "";
943
- var version = "";
944
- if (nameAndVersion.startsWith("@")) {
945
- var splitInfo = nameAndVersion.split("@");
946
- splitInfo[0] = "@";
942
+ var name = '';
943
+ var version = '';
944
+ if (nameAndVersion.startsWith('@')) {
945
+ var splitInfo = nameAndVersion.split('@');
946
+ splitInfo[0] = '@';
947
947
  name = splitInfo[0] + splitInfo[1];
948
948
  version = splitInfo[2];
949
- } else if (nameAndVersion.includes("@")) {
949
+ } else if (nameAndVersion.includes('@')) {
950
950
  var ref;
951
- ref = _sliced_to_array$1(nameAndVersion.split("@"), 2), name = ref[0], version = ref[1];
952
- version = version.replace(/[\^~>|>=]/g, "");
951
+ ref = _sliced_to_array$1(nameAndVersion.split('@'), 2), name = ref[0], version = ref[1];
952
+ version = version.replace(/[\^~>|>=]/g, '');
953
953
  }
954
954
  return {
955
955
  name: name,
956
956
  version: version
957
957
  };
958
958
  };
959
- if (moduleType === "provide-module") {
959
+ if (moduleType === 'provide-module') {
960
960
  // identifier(rspack) = provide shared module (default) react@18.2.0 = /temp/node_modules/.pnpm/react@18.2.0/node_modules/react/index.js
961
961
  // identifier(webpack) = provide module (default) react@18.2.0 = /temp/node_modules/.pnpm/react@18.2.0/node_modules/react/index.js
962
- var data = identifier.split(" ");
962
+ var data = identifier.split(' ');
963
963
  var nameAndVersion = this.isRspack ? data[4] : data[3];
964
964
  var _parseResolvedIdentifier = parseResolvedIdentifier(nameAndVersion), name = _parseResolvedIdentifier.name, version = _parseResolvedIdentifier.version;
965
965
  if (name && version) {
@@ -967,13 +967,13 @@ var ModuleHandler = /*#__PURE__*/ function() {
967
967
  collectRelationshipMap(mod, name);
968
968
  }
969
969
  }
970
- if (moduleType === "consume-shared-module") {
970
+ if (moduleType === 'consume-shared-module') {
971
971
  // identifier(rspack) = consume shared module (default) lodash/get@^4.17.21 (strict) (fallback: /temp/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/get.js)
972
972
  // identifier(webpack) = consume-shared-module|default|react-dom|!=1.8...2...0|false|/temp/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/index.js|true|false
973
- var SEPARATOR = this.isRspack ? " " : "|";
973
+ var SEPARATOR = this.isRspack ? ' ' : '|';
974
974
  var data1 = identifier.split(SEPARATOR);
975
- var pkgName = "";
976
- var pkgVersion = "";
975
+ var pkgName = '';
976
+ var pkgVersion = '';
977
977
  if (this.isRspack) {
978
978
  var nameAndVersion1 = data1[4];
979
979
  var res = parseResolvedIdentifier(nameAndVersion1);
@@ -982,14 +982,14 @@ var ModuleHandler = /*#__PURE__*/ function() {
982
982
  } else {
983
983
  pkgName = data1[2];
984
984
  var pkgVersionRange = data1[3];
985
- pkgVersion = "";
986
- if (pkgVersionRange.startsWith("=")) {
987
- pkgVersion = data1[3].replace("=", "");
985
+ pkgVersion = '';
986
+ if (pkgVersionRange.startsWith('=')) {
987
+ pkgVersion = data1[3].replace('=', '');
988
988
  } else {
989
989
  if (sharedManagerNormalizedOptions[pkgName]) {
990
990
  pkgVersion = sharedManagerNormalizedOptions[pkgName].version;
991
991
  } else {
992
- var fullPkgName = pkgName.split("/").slice(0, -1).join("/");
992
+ var fullPkgName = pkgName.split('/').slice(0, -1).join('/');
993
993
  // pkgName: react-dom/
994
994
  if (sharedManagerNormalizedOptions["".concat(fullPkgName, "/")]) {
995
995
  if (sharedManagerNormalizedOptions[fullPkgName]) {
@@ -1018,14 +1018,14 @@ var ModuleHandler = /*#__PURE__*/ function() {
1018
1018
  }
1019
1019
  var remoteManagerNormalizedOptions = this._remoteManager.normalizedOptions;
1020
1020
  // identifier = remote (default) webpack/container/reference/app2 ./Button
1021
- var data = identifier.split(" ");
1021
+ var data = identifier.split(' ');
1022
1022
  if (data.length === 4) {
1023
- var moduleName = data[3].replace("./", "");
1024
- var remoteAlias = data[2].replace("webpack/container/reference/", "");
1023
+ var moduleName = data[3].replace('./', '');
1024
+ var remoteAlias = data[2].replace('webpack/container/reference/', '');
1025
1025
  var normalizedRemote = remoteManagerNormalizedOptions[remoteAlias];
1026
1026
  var basicRemote = {
1027
1027
  alias: normalizedRemote.alias,
1028
- consumingFederationContainerName: this._options.name || "",
1028
+ consumingFederationContainerName: this._options.name || '',
1029
1029
  federationContainerName: remoteManagerNormalizedOptions[remoteAlias].name,
1030
1030
  moduleName: moduleName,
1031
1031
  // @ts-ignore to deduplicate
@@ -1035,7 +1035,7 @@ var ModuleHandler = /*#__PURE__*/ function() {
1035
1035
  return;
1036
1036
  }
1037
1037
  var remote;
1038
- if ("version" in normalizedRemote) {
1038
+ if ('version' in normalizedRemote) {
1039
1039
  remote = _object_spread_props$1(_object_spread$1({}, basicRemote), {
1040
1040
  version: normalizedRemote.version
1041
1041
  });
@@ -1053,7 +1053,7 @@ var ModuleHandler = /*#__PURE__*/ function() {
1053
1053
  var exposeModName = _this.isRspack ? moduleName : resolvedModule;
1054
1054
  if (userRequest && exposeModName && remotesConsumerMap[userRequest]) {
1055
1055
  // @ts-ignore to deduplicate
1056
- remotesConsumerMap[userRequest].usedIn.add(exposeModName.replace("./", ""));
1056
+ remotesConsumerMap[userRequest].usedIn.add(exposeModName.replace('./', ''));
1057
1057
  }
1058
1058
  });
1059
1059
  }
@@ -1068,10 +1068,10 @@ var ModuleHandler = /*#__PURE__*/ function() {
1068
1068
  return;
1069
1069
  }
1070
1070
  // identifier: container entry (default) [[".",{"import":["./src/routes/page.tsx"],"name":"__federation_expose_default_export"}]]'
1071
- var data = identifier.split(" ");
1071
+ var data = identifier.split(' ');
1072
1072
  JSON.parse(data[3]).forEach(function(param) {
1073
1073
  var _param = _sliced_to_array$1(param, 2), prefixedName = _param[0], file = _param[1];
1074
- var exposeModuleName = prefixedName.replace("./", "");
1074
+ var exposeModuleName = prefixedName.replace('./', '');
1075
1075
  // TODO: support multiple import
1076
1076
  exposesMap[getFileNameWithOutExt(file.import[0])] = {
1077
1077
  path: prefixedName,
@@ -1104,17 +1104,17 @@ var ModuleHandler = /*#__PURE__*/ function() {
1104
1104
  var sharedMap = {};
1105
1105
  var isSharedModule = function(moduleType) {
1106
1106
  return Boolean(moduleType && [
1107
- "provide-module",
1108
- "consume-shared-module"
1107
+ 'provide-module',
1108
+ 'consume-shared-module'
1109
1109
  ].includes(moduleType));
1110
1110
  };
1111
1111
  var isContainerModule = function(identifier) {
1112
- var data = identifier.split(" ");
1113
- return Boolean(data[0] === "container" && data[1] === "entry");
1112
+ var data = identifier.split(' ');
1113
+ return Boolean(data[0] === 'container' && data[1] === 'entry');
1114
1114
  };
1115
1115
  var isRemoteModule = function(identifier) {
1116
- var data = identifier.split(" ");
1117
- return data[0] === "remote";
1116
+ var data = identifier.split(' ');
1117
+ return data[0] === 'remote';
1118
1118
  };
1119
1119
  // handle remote/expose
1120
1120
  this._modules.forEach(function(mod) {
@@ -1406,8 +1406,8 @@ function _templateObject() {
1406
1406
  }
1407
1407
  function _templateObject1() {
1408
1408
  var data = _tagged_template_literal([
1409
- "{bold {yellow [ ",
1410
- " ]: Manifest will not generate, because publicPath can only be absolute path, but got '",
1409
+ "{bold {blue [ ",
1410
+ " ]: Manifest will use absolute path resolution via its host at runtime, reason: publicPath='",
1411
1411
  "'}}"
1412
1412
  ]);
1413
1413
  _templateObject1 = function _templateObject() {
@@ -1421,7 +1421,7 @@ var StatsManager = /*#__PURE__*/ function() {
1421
1421
  _define_property$1(this, "_options", {});
1422
1422
  _define_property$1(this, "_publicPath", void 0);
1423
1423
  _define_property$1(this, "_pluginVersion", void 0);
1424
- _define_property$1(this, "_bundler", "webpack");
1424
+ _define_property$1(this, "_bundler", 'webpack');
1425
1425
  _define_property$1(this, "_containerManager", new ContainerManager());
1426
1426
  _define_property$1(this, "_remoteManager", new RemoteManager());
1427
1427
  _define_property$1(this, "_sharedManager", new SharedManager());
@@ -1434,7 +1434,7 @@ var StatsManager = /*#__PURE__*/ function() {
1434
1434
  var pkg = this._pkgJsonManager.readPKGJson(process.cwd());
1435
1435
  return {
1436
1436
  buildVersion: utils.getBuildVersion(),
1437
- buildName: utils.getBuildName() || pkg["name"]
1437
+ buildName: utils.getBuildName() || pkg['name']
1438
1438
  };
1439
1439
  }
1440
1440
  },
@@ -1453,32 +1453,32 @@ var StatsManager = /*#__PURE__*/ function() {
1453
1453
  var type = this._pkgJsonManager.getExposeGarfishModuleType(context || process.cwd());
1454
1454
  var getRemoteEntryName = function() {
1455
1455
  if (!_this._containerManager.enable) {
1456
- return "";
1456
+ return '';
1457
1457
  }
1458
- assert(name, "name is required");
1458
+ assert(name, 'name is required');
1459
1459
  var remoteEntryPoint = compilation.entrypoints.get(name);
1460
- assert(remoteEntryPoint, "Can not get remoteEntry entryPoint!");
1460
+ assert(remoteEntryPoint, 'Can not get remoteEntry entryPoint!');
1461
1461
  var remoteEntryNameChunk = compilation.namedChunks.get(name);
1462
- assert(remoteEntryNameChunk, "Can not get remoteEntry chunk!");
1462
+ assert(remoteEntryNameChunk, 'Can not get remoteEntry chunk!');
1463
1463
  var files = Array.from(remoteEntryNameChunk.files).filter(function(f) {
1464
- return !f.includes(HOT_UPDATE_SUFFIX);
1464
+ return !f.includes(HOT_UPDATE_SUFFIX) && !f.endsWith('.css');
1465
1465
  });
1466
- assert(files.length === 1, "remoteEntry chunk should not have multiple files!, current files: ".concat(files.join(",")));
1466
+ assert(files.length === 1, "remoteEntry chunk should not have multiple files!, current files: ".concat(files.join(',')));
1467
1467
  var remoteEntryName = files[0];
1468
1468
  return remoteEntryName;
1469
1469
  };
1470
1470
  var globalName = this._containerManager.globalEntryName;
1471
1471
  assert(globalName, 'Can not get library.name, please ensure you have set library.name and the type is "string" !');
1472
- assert(this._pluginVersion, "Can not get pluginVersion, please ensure you have set pluginVersion !");
1472
+ assert(this._pluginVersion, 'Can not get pluginVersion, please ensure you have set pluginVersion !');
1473
1473
  var metaData = {
1474
1474
  name: name,
1475
1475
  type: type,
1476
1476
  buildInfo: buildInfo,
1477
1477
  remoteEntry: {
1478
1478
  name: getRemoteEntryName(),
1479
- path: "",
1479
+ path: '',
1480
1480
  // same as the types supported by runtime, currently only global/var/script is supported
1481
- type: "global"
1481
+ type: 'global'
1482
1482
  },
1483
1483
  types: getTypesMetaInfo(this._options, compiler.context),
1484
1484
  globalName: globalName,
@@ -1497,10 +1497,10 @@ var StatsManager = /*#__PURE__*/ function() {
1497
1497
  return false;
1498
1498
  }
1499
1499
  var array = [
1500
- module.name.includes("container entry"),
1501
- module.name.includes("remote "),
1502
- module.name.includes("shared module "),
1503
- module.name.includes("provide module ")
1500
+ module.name.includes('container entry'),
1501
+ module.name.includes('remote '),
1502
+ module.name.includes('shared module '),
1503
+ module.name.includes('provide module ')
1504
1504
  ];
1505
1505
  return array.some(function(item) {
1506
1506
  return item;
@@ -1516,7 +1516,7 @@ var StatsManager = /*#__PURE__*/ function() {
1516
1516
  var exposeFileNameImportMap = this._containerManager.exposeFileNameImportMap;
1517
1517
  var assets = {};
1518
1518
  chunks.forEach(function(chunk) {
1519
- if (typeof chunk.name === "string" && exposeFileNameImportMap[chunk.name]) {
1519
+ if (typeof chunk.name === 'string' && exposeFileNameImportMap[chunk.name]) {
1520
1520
  // TODO: support multiple import
1521
1521
  var exposeKey = exposeFileNameImportMap[chunk.name][0];
1522
1522
  assets[getFileNameWithOutExt(exposeKey)] = getAssetsByChunk(chunk);
@@ -1533,7 +1533,7 @@ var StatsManager = /*#__PURE__*/ function() {
1533
1533
  return false;
1534
1534
  }
1535
1535
  var array = [
1536
- module.name.includes("consume shared module ")
1536
+ module.name.includes('consume shared module ')
1537
1537
  ];
1538
1538
  return array.some(function(item) {
1539
1539
  return item;
@@ -1612,7 +1612,7 @@ var StatsManager = /*#__PURE__*/ function() {
1612
1612
  remotes: [],
1613
1613
  exposes: []
1614
1614
  };
1615
- if (typeof manifestOptions === "object" && manifestOptions.disableAssetsAnalyze) {
1615
+ if (typeof manifestOptions === 'object' && manifestOptions.disableAssetsAnalyze) {
1616
1616
  remotes = _this._remoteManager.statsRemoteWithEmptyUsedIn;
1617
1617
  stats.remotes = remotes;
1618
1618
  return [
@@ -1633,9 +1633,9 @@ var StatsManager = /*#__PURE__*/ function() {
1633
1633
  chunks: false,
1634
1634
  reasons: true
1635
1635
  };
1636
- if (_this._bundler === "webpack") {
1637
- statsOptions["cached"] = true;
1638
- statsOptions["cachedModules"] = true;
1636
+ if (_this._bundler === 'webpack') {
1637
+ statsOptions['cached'] = true;
1638
+ statsOptions['cachedModules'] = true;
1639
1639
  }
1640
1640
  webpackStats = liveStats.toJson(statsOptions);
1641
1641
  filteredModules = _this._getFilteredModules(webpackStats);
@@ -1772,7 +1772,7 @@ var StatsManager = /*#__PURE__*/ function() {
1772
1772
  ];
1773
1773
  case 1:
1774
1774
  stats = _state.sent();
1775
- if (!(typeof manifestOptions === "object" && manifestOptions.additionalData)) return [
1775
+ if (!(typeof manifestOptions === 'object' && manifestOptions.additionalData)) return [
1776
1776
  3,
1777
1777
  3
1778
1778
  ];
@@ -1812,12 +1812,12 @@ var StatsManager = /*#__PURE__*/ function() {
1812
1812
  key: "validate",
1813
1813
  value: function validate(compiler) {
1814
1814
  var _compiler_options = compiler.options, publicPath = _compiler_options.output.publicPath;
1815
- if (typeof publicPath !== "string") {
1815
+ if (typeof publicPath !== 'string') {
1816
1816
  console.warn(chalk(_templateObject(), PLUGIN_IDENTIFIER, publicPath));
1817
1817
  return false;
1818
- } else if (publicPath === "auto") {
1818
+ } else if (publicPath === 'auto') {
1819
1819
  console.warn(chalk(_templateObject1(), PLUGIN_IDENTIFIER, publicPath));
1820
- return false;
1820
+ return true;
1821
1821
  }
1822
1822
  return true;
1823
1823
  }
@@ -1993,12 +1993,12 @@ var StatsPlugin = /*#__PURE__*/ function() {
1993
1993
  function StatsPlugin(options, param) {
1994
1994
  var pluginVersion = param.pluginVersion, bundler = param.bundler;
1995
1995
  _class_call_check(this, StatsPlugin);
1996
- _define_property(this, "name", "StatsPlugin");
1996
+ _define_property(this, "name", 'StatsPlugin');
1997
1997
  _define_property(this, "_options", {});
1998
1998
  _define_property(this, "_statsManager", new StatsManager());
1999
1999
  _define_property(this, "_manifestManager", new ManifestManager());
2000
2000
  _define_property(this, "_enable", true);
2001
- _define_property(this, "_bundler", "webpack");
2001
+ _define_property(this, "_bundler", 'webpack');
2002
2002
  try {
2003
2003
  this._options = options;
2004
2004
  this._bundler = bundler;
@@ -2027,10 +2027,10 @@ var StatsPlugin = /*#__PURE__*/ function() {
2027
2027
  if (!res) {
2028
2028
  return;
2029
2029
  }
2030
- compiler.hooks.thisCompilation.tap("generateStats", function(compilation) {
2030
+ compiler.hooks.thisCompilation.tap('generateStats', function(compilation) {
2031
2031
  var _this1 = _this;
2032
2032
  compilation.hooks.processAssets.tapPromise({
2033
- name: "generateStats",
2033
+ name: 'generateStats',
2034
2034
  // @ts-ignore use runtime variable in case peer dep not installed
2035
2035
  stage: compilation.constructor.PROCESS_ASSETS_STAGE_OPTIMIZE_TRANSFER
2036
2036
  }, /*#__PURE__*/ _async_to_generator(function() {
@@ -2054,7 +2054,7 @@ var StatsPlugin = /*#__PURE__*/ function() {
2054
2054
  publicPath: _this1._statsManager.getPublicPath(compiler),
2055
2055
  compiler: compiler,
2056
2056
  bundler: _this1._bundler,
2057
- additionalData: typeof _this1._options.manifest === "object" ? _this1._options.manifest.additionalData : undefined
2057
+ additionalData: typeof _this1._options.manifest === 'object' ? _this1._options.manifest.additionalData : undefined
2058
2058
  });
2059
2059
  _state.label = 2;
2060
2060
  case 2:
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/manifest",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
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.12",
3
+ "version": "0.1.13",
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.12",
28
- "@module-federation/dts-plugin": "0.1.12",
29
- "@module-federation/managers": "0.1.12"
27
+ "@module-federation/sdk": "0.1.13",
28
+ "@module-federation/dts-plugin": "0.1.13",
29
+ "@module-federation/managers": "0.1.13"
30
30
  },
31
31
  "exports": {
32
32
  ".": {