@module-federation/manifest 0.0.0-next-20240412091739 → 0.0.0-next-20240412103714
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 +52 -212
- package/dist/index.esm.js +52 -212
- package/dist/src/ManifestManager.d.ts +1 -3
- package/dist/src/StatsPlugin.d.ts +0 -1
- package/package.json +4 -4
package/dist/index.cjs.js
CHANGED
|
@@ -437,35 +437,6 @@ function getTypesMetaInfo(pluginOptions, context) {
|
|
|
437
437
|
}
|
|
438
438
|
}
|
|
439
439
|
|
|
440
|
-
function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
|
|
441
|
-
try {
|
|
442
|
-
var info = gen[key](arg);
|
|
443
|
-
var value = info.value;
|
|
444
|
-
} catch (error) {
|
|
445
|
-
reject(error);
|
|
446
|
-
return;
|
|
447
|
-
}
|
|
448
|
-
if (info.done) {
|
|
449
|
-
resolve(value);
|
|
450
|
-
} else {
|
|
451
|
-
Promise.resolve(value).then(_next, _throw);
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
function _async_to_generator$2(fn) {
|
|
455
|
-
return function() {
|
|
456
|
-
var self = this, args = arguments;
|
|
457
|
-
return new Promise(function(resolve, reject) {
|
|
458
|
-
var gen = fn.apply(self, args);
|
|
459
|
-
function _next(value) {
|
|
460
|
-
asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "next", value);
|
|
461
|
-
}
|
|
462
|
-
function _throw(err) {
|
|
463
|
-
asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "throw", err);
|
|
464
|
-
}
|
|
465
|
-
_next(undefined);
|
|
466
|
-
});
|
|
467
|
-
};
|
|
468
|
-
}
|
|
469
440
|
function _class_call_check$3(instance, Constructor) {
|
|
470
441
|
if (!(instance instanceof Constructor)) {
|
|
471
442
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -523,101 +494,6 @@ function _tagged_template_literal$1(strings, raw) {
|
|
|
523
494
|
}
|
|
524
495
|
}));
|
|
525
496
|
}
|
|
526
|
-
function _ts_generator$2(thisArg, body) {
|
|
527
|
-
var f, y, t, g, _ = {
|
|
528
|
-
label: 0,
|
|
529
|
-
sent: function() {
|
|
530
|
-
if (t[0] & 1) throw t[1];
|
|
531
|
-
return t[1];
|
|
532
|
-
},
|
|
533
|
-
trys: [],
|
|
534
|
-
ops: []
|
|
535
|
-
};
|
|
536
|
-
return g = {
|
|
537
|
-
next: verb(0),
|
|
538
|
-
"throw": verb(1),
|
|
539
|
-
"return": verb(2)
|
|
540
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
541
|
-
return this;
|
|
542
|
-
}), g;
|
|
543
|
-
function verb(n) {
|
|
544
|
-
return function(v) {
|
|
545
|
-
return step([
|
|
546
|
-
n,
|
|
547
|
-
v
|
|
548
|
-
]);
|
|
549
|
-
};
|
|
550
|
-
}
|
|
551
|
-
function step(op) {
|
|
552
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
553
|
-
while(_)try {
|
|
554
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
555
|
-
if (y = 0, t) op = [
|
|
556
|
-
op[0] & 2,
|
|
557
|
-
t.value
|
|
558
|
-
];
|
|
559
|
-
switch(op[0]){
|
|
560
|
-
case 0:
|
|
561
|
-
case 1:
|
|
562
|
-
t = op;
|
|
563
|
-
break;
|
|
564
|
-
case 4:
|
|
565
|
-
_.label++;
|
|
566
|
-
return {
|
|
567
|
-
value: op[1],
|
|
568
|
-
done: false
|
|
569
|
-
};
|
|
570
|
-
case 5:
|
|
571
|
-
_.label++;
|
|
572
|
-
y = op[1];
|
|
573
|
-
op = [
|
|
574
|
-
0
|
|
575
|
-
];
|
|
576
|
-
continue;
|
|
577
|
-
case 7:
|
|
578
|
-
op = _.ops.pop();
|
|
579
|
-
_.trys.pop();
|
|
580
|
-
continue;
|
|
581
|
-
default:
|
|
582
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
583
|
-
_ = 0;
|
|
584
|
-
continue;
|
|
585
|
-
}
|
|
586
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
587
|
-
_.label = op[1];
|
|
588
|
-
break;
|
|
589
|
-
}
|
|
590
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
591
|
-
_.label = t[1];
|
|
592
|
-
t = op;
|
|
593
|
-
break;
|
|
594
|
-
}
|
|
595
|
-
if (t && _.label < t[2]) {
|
|
596
|
-
_.label = t[2];
|
|
597
|
-
_.ops.push(op);
|
|
598
|
-
break;
|
|
599
|
-
}
|
|
600
|
-
if (t[2]) _.ops.pop();
|
|
601
|
-
_.trys.pop();
|
|
602
|
-
continue;
|
|
603
|
-
}
|
|
604
|
-
op = body.call(thisArg, _);
|
|
605
|
-
} catch (e) {
|
|
606
|
-
op = [
|
|
607
|
-
6,
|
|
608
|
-
e
|
|
609
|
-
];
|
|
610
|
-
y = 0;
|
|
611
|
-
} finally{
|
|
612
|
-
f = t = 0;
|
|
613
|
-
}
|
|
614
|
-
if (op[0] & 5) throw op[1];
|
|
615
|
-
return {
|
|
616
|
-
value: op[0] ? op[1] : void 0,
|
|
617
|
-
done: true
|
|
618
|
-
};
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
497
|
function _templateObject$1() {
|
|
622
498
|
var data = _tagged_template_literal$1([
|
|
623
499
|
"{bold {greenBright [ ",
|
|
@@ -658,89 +534,57 @@ var ManifestManager = /*#__PURE__*/ function() {
|
|
|
658
534
|
{
|
|
659
535
|
key: "generateManifest",
|
|
660
536
|
value: function generateManifest(options) {
|
|
661
|
-
var
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
_this._manifest = manifest;
|
|
713
|
-
manifestFileName = _this.fileName;
|
|
714
|
-
if (!additionalData) return [
|
|
715
|
-
3,
|
|
716
|
-
2
|
|
717
|
-
];
|
|
718
|
-
return [
|
|
719
|
-
4,
|
|
720
|
-
additionalData({
|
|
721
|
-
manifest: _this._manifest,
|
|
722
|
-
stats: stats,
|
|
723
|
-
pluginOptions: _this._options,
|
|
724
|
-
compiler: compiler,
|
|
725
|
-
compilation: compilation,
|
|
726
|
-
bundler: bundler
|
|
727
|
-
})
|
|
728
|
-
];
|
|
729
|
-
case 1:
|
|
730
|
-
ret = _state.sent();
|
|
731
|
-
_this._manifest = ret || _this._manifest;
|
|
732
|
-
_state.label = 2;
|
|
733
|
-
case 2:
|
|
734
|
-
compilation.emitAsset(manifestFileName, new compiler.webpack.sources.RawSource(JSON.stringify(_this._manifest, null, 2)));
|
|
735
|
-
if (isDev()) {
|
|
736
|
-
console.log(chalk__default["default"](_templateObject$1(), PLUGIN_IDENTIFIER, publicPath, manifestFileName));
|
|
737
|
-
}
|
|
738
|
-
return [
|
|
739
|
-
2
|
|
740
|
-
];
|
|
741
|
-
}
|
|
742
|
-
});
|
|
743
|
-
})();
|
|
537
|
+
var compilation = options.compilation, publicPath = options.publicPath, stats = options.stats, compiler = options.compiler;
|
|
538
|
+
var manifest = _object_spread$2({}, stats);
|
|
539
|
+
manifest.exposes = Object.keys(stats.exposes).reduce(function(sum, cur) {
|
|
540
|
+
var statsExpose = manifest.exposes[cur];
|
|
541
|
+
var expose = {
|
|
542
|
+
id: statsExpose.id,
|
|
543
|
+
name: statsExpose.name,
|
|
544
|
+
assets: statsExpose.assets,
|
|
545
|
+
path: statsExpose.path
|
|
546
|
+
};
|
|
547
|
+
sum.push(expose);
|
|
548
|
+
return sum;
|
|
549
|
+
}, []);
|
|
550
|
+
manifest.shared = Object.keys(stats.shared).reduce(function(sum, cur) {
|
|
551
|
+
var statsShared = manifest.shared[cur];
|
|
552
|
+
var shared = {
|
|
553
|
+
id: statsShared.id,
|
|
554
|
+
name: statsShared.name,
|
|
555
|
+
version: statsShared.version,
|
|
556
|
+
singleton: statsShared.singleton,
|
|
557
|
+
requiredVersion: statsShared.requiredVersion,
|
|
558
|
+
hash: statsShared.hash,
|
|
559
|
+
assets: statsShared.assets
|
|
560
|
+
};
|
|
561
|
+
sum.push(shared);
|
|
562
|
+
return sum;
|
|
563
|
+
}, []);
|
|
564
|
+
manifest.remotes = Object.keys(stats.remotes).reduce(function(sum, cur) {
|
|
565
|
+
var statsRemote = manifest.remotes[cur];
|
|
566
|
+
// @ts-ignore version/entry will be added as follow
|
|
567
|
+
var remote = {
|
|
568
|
+
federationContainerName: statsRemote.federationContainerName,
|
|
569
|
+
moduleName: statsRemote.moduleName,
|
|
570
|
+
alias: statsRemote.alias
|
|
571
|
+
};
|
|
572
|
+
if ("entry" in statsRemote) {
|
|
573
|
+
// @ts-ignore
|
|
574
|
+
remote.entry = statsRemote.entry;
|
|
575
|
+
} else if ("version" in statsRemote) {
|
|
576
|
+
// @ts-ignore
|
|
577
|
+
remote.entry = statsRemote.version;
|
|
578
|
+
}
|
|
579
|
+
sum.push(remote);
|
|
580
|
+
return sum;
|
|
581
|
+
}, []);
|
|
582
|
+
this._manifest = manifest;
|
|
583
|
+
var manifestFileName = this.fileName;
|
|
584
|
+
compilation.emitAsset(manifestFileName, new compiler.webpack.sources.RawSource(JSON.stringify(manifest, null, 2)));
|
|
585
|
+
if (isDev()) {
|
|
586
|
+
console.log(chalk__default["default"](_templateObject$1(), PLUGIN_IDENTIFIER, publicPath, manifestFileName));
|
|
587
|
+
}
|
|
744
588
|
}
|
|
745
589
|
}
|
|
746
590
|
]);
|
|
@@ -2007,10 +1851,8 @@ var StatsPlugin = /*#__PURE__*/ function() {
|
|
|
2007
1851
|
_define_property(this, "_statsManager", new StatsManager());
|
|
2008
1852
|
_define_property(this, "_manifestManager", new ManifestManager());
|
|
2009
1853
|
_define_property(this, "_enable", true);
|
|
2010
|
-
_define_property(this, "_bundler", "webpack");
|
|
2011
1854
|
try {
|
|
2012
1855
|
this._options = options;
|
|
2013
|
-
this._bundler = bundler;
|
|
2014
1856
|
this._statsManager.init(this._options, {
|
|
2015
1857
|
pluginVersion: pluginVersion,
|
|
2016
1858
|
bundler: bundler
|
|
@@ -2061,9 +1903,7 @@ var StatsPlugin = /*#__PURE__*/ function() {
|
|
|
2061
1903
|
compilation: compilation,
|
|
2062
1904
|
stats: stats,
|
|
2063
1905
|
publicPath: _this1._statsManager.getPublicPath(compiler),
|
|
2064
|
-
compiler: compiler
|
|
2065
|
-
bundler: _this1._bundler,
|
|
2066
|
-
additionalData: typeof _this1._options.manifest === "object" ? _this1._options.manifest.additionalData : undefined
|
|
1906
|
+
compiler: compiler
|
|
2067
1907
|
});
|
|
2068
1908
|
_state.label = 2;
|
|
2069
1909
|
case 2:
|
package/dist/index.esm.js
CHANGED
|
@@ -428,35 +428,6 @@ function getTypesMetaInfo(pluginOptions, context) {
|
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
430
|
|
|
431
|
-
function asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, key, arg) {
|
|
432
|
-
try {
|
|
433
|
-
var info = gen[key](arg);
|
|
434
|
-
var value = info.value;
|
|
435
|
-
} catch (error) {
|
|
436
|
-
reject(error);
|
|
437
|
-
return;
|
|
438
|
-
}
|
|
439
|
-
if (info.done) {
|
|
440
|
-
resolve(value);
|
|
441
|
-
} else {
|
|
442
|
-
Promise.resolve(value).then(_next, _throw);
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
function _async_to_generator$2(fn) {
|
|
446
|
-
return function() {
|
|
447
|
-
var self = this, args = arguments;
|
|
448
|
-
return new Promise(function(resolve, reject) {
|
|
449
|
-
var gen = fn.apply(self, args);
|
|
450
|
-
function _next(value) {
|
|
451
|
-
asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "next", value);
|
|
452
|
-
}
|
|
453
|
-
function _throw(err) {
|
|
454
|
-
asyncGeneratorStep$2(gen, resolve, reject, _next, _throw, "throw", err);
|
|
455
|
-
}
|
|
456
|
-
_next(undefined);
|
|
457
|
-
});
|
|
458
|
-
};
|
|
459
|
-
}
|
|
460
431
|
function _class_call_check$3(instance, Constructor) {
|
|
461
432
|
if (!(instance instanceof Constructor)) {
|
|
462
433
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -514,101 +485,6 @@ function _tagged_template_literal$1(strings, raw) {
|
|
|
514
485
|
}
|
|
515
486
|
}));
|
|
516
487
|
}
|
|
517
|
-
function _ts_generator$2(thisArg, body) {
|
|
518
|
-
var f, y, t, g, _ = {
|
|
519
|
-
label: 0,
|
|
520
|
-
sent: function() {
|
|
521
|
-
if (t[0] & 1) throw t[1];
|
|
522
|
-
return t[1];
|
|
523
|
-
},
|
|
524
|
-
trys: [],
|
|
525
|
-
ops: []
|
|
526
|
-
};
|
|
527
|
-
return g = {
|
|
528
|
-
next: verb(0),
|
|
529
|
-
"throw": verb(1),
|
|
530
|
-
"return": verb(2)
|
|
531
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
532
|
-
return this;
|
|
533
|
-
}), g;
|
|
534
|
-
function verb(n) {
|
|
535
|
-
return function(v) {
|
|
536
|
-
return step([
|
|
537
|
-
n,
|
|
538
|
-
v
|
|
539
|
-
]);
|
|
540
|
-
};
|
|
541
|
-
}
|
|
542
|
-
function step(op) {
|
|
543
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
544
|
-
while(_)try {
|
|
545
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
546
|
-
if (y = 0, t) op = [
|
|
547
|
-
op[0] & 2,
|
|
548
|
-
t.value
|
|
549
|
-
];
|
|
550
|
-
switch(op[0]){
|
|
551
|
-
case 0:
|
|
552
|
-
case 1:
|
|
553
|
-
t = op;
|
|
554
|
-
break;
|
|
555
|
-
case 4:
|
|
556
|
-
_.label++;
|
|
557
|
-
return {
|
|
558
|
-
value: op[1],
|
|
559
|
-
done: false
|
|
560
|
-
};
|
|
561
|
-
case 5:
|
|
562
|
-
_.label++;
|
|
563
|
-
y = op[1];
|
|
564
|
-
op = [
|
|
565
|
-
0
|
|
566
|
-
];
|
|
567
|
-
continue;
|
|
568
|
-
case 7:
|
|
569
|
-
op = _.ops.pop();
|
|
570
|
-
_.trys.pop();
|
|
571
|
-
continue;
|
|
572
|
-
default:
|
|
573
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
574
|
-
_ = 0;
|
|
575
|
-
continue;
|
|
576
|
-
}
|
|
577
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
578
|
-
_.label = op[1];
|
|
579
|
-
break;
|
|
580
|
-
}
|
|
581
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
582
|
-
_.label = t[1];
|
|
583
|
-
t = op;
|
|
584
|
-
break;
|
|
585
|
-
}
|
|
586
|
-
if (t && _.label < t[2]) {
|
|
587
|
-
_.label = t[2];
|
|
588
|
-
_.ops.push(op);
|
|
589
|
-
break;
|
|
590
|
-
}
|
|
591
|
-
if (t[2]) _.ops.pop();
|
|
592
|
-
_.trys.pop();
|
|
593
|
-
continue;
|
|
594
|
-
}
|
|
595
|
-
op = body.call(thisArg, _);
|
|
596
|
-
} catch (e) {
|
|
597
|
-
op = [
|
|
598
|
-
6,
|
|
599
|
-
e
|
|
600
|
-
];
|
|
601
|
-
y = 0;
|
|
602
|
-
} finally{
|
|
603
|
-
f = t = 0;
|
|
604
|
-
}
|
|
605
|
-
if (op[0] & 5) throw op[1];
|
|
606
|
-
return {
|
|
607
|
-
value: op[0] ? op[1] : void 0,
|
|
608
|
-
done: true
|
|
609
|
-
};
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
488
|
function _templateObject$1() {
|
|
613
489
|
var data = _tagged_template_literal$1([
|
|
614
490
|
"{bold {greenBright [ ",
|
|
@@ -649,89 +525,57 @@ var ManifestManager = /*#__PURE__*/ function() {
|
|
|
649
525
|
{
|
|
650
526
|
key: "generateManifest",
|
|
651
527
|
value: function generateManifest(options) {
|
|
652
|
-
var
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
_this._manifest = manifest;
|
|
704
|
-
manifestFileName = _this.fileName;
|
|
705
|
-
if (!additionalData) return [
|
|
706
|
-
3,
|
|
707
|
-
2
|
|
708
|
-
];
|
|
709
|
-
return [
|
|
710
|
-
4,
|
|
711
|
-
additionalData({
|
|
712
|
-
manifest: _this._manifest,
|
|
713
|
-
stats: stats,
|
|
714
|
-
pluginOptions: _this._options,
|
|
715
|
-
compiler: compiler,
|
|
716
|
-
compilation: compilation,
|
|
717
|
-
bundler: bundler
|
|
718
|
-
})
|
|
719
|
-
];
|
|
720
|
-
case 1:
|
|
721
|
-
ret = _state.sent();
|
|
722
|
-
_this._manifest = ret || _this._manifest;
|
|
723
|
-
_state.label = 2;
|
|
724
|
-
case 2:
|
|
725
|
-
compilation.emitAsset(manifestFileName, new compiler.webpack.sources.RawSource(JSON.stringify(_this._manifest, null, 2)));
|
|
726
|
-
if (isDev()) {
|
|
727
|
-
console.log(chalk(_templateObject$1(), PLUGIN_IDENTIFIER, publicPath, manifestFileName));
|
|
728
|
-
}
|
|
729
|
-
return [
|
|
730
|
-
2
|
|
731
|
-
];
|
|
732
|
-
}
|
|
733
|
-
});
|
|
734
|
-
})();
|
|
528
|
+
var compilation = options.compilation, publicPath = options.publicPath, stats = options.stats, compiler = options.compiler;
|
|
529
|
+
var manifest = _object_spread$2({}, stats);
|
|
530
|
+
manifest.exposes = Object.keys(stats.exposes).reduce(function(sum, cur) {
|
|
531
|
+
var statsExpose = manifest.exposes[cur];
|
|
532
|
+
var expose = {
|
|
533
|
+
id: statsExpose.id,
|
|
534
|
+
name: statsExpose.name,
|
|
535
|
+
assets: statsExpose.assets,
|
|
536
|
+
path: statsExpose.path
|
|
537
|
+
};
|
|
538
|
+
sum.push(expose);
|
|
539
|
+
return sum;
|
|
540
|
+
}, []);
|
|
541
|
+
manifest.shared = Object.keys(stats.shared).reduce(function(sum, cur) {
|
|
542
|
+
var statsShared = manifest.shared[cur];
|
|
543
|
+
var shared = {
|
|
544
|
+
id: statsShared.id,
|
|
545
|
+
name: statsShared.name,
|
|
546
|
+
version: statsShared.version,
|
|
547
|
+
singleton: statsShared.singleton,
|
|
548
|
+
requiredVersion: statsShared.requiredVersion,
|
|
549
|
+
hash: statsShared.hash,
|
|
550
|
+
assets: statsShared.assets
|
|
551
|
+
};
|
|
552
|
+
sum.push(shared);
|
|
553
|
+
return sum;
|
|
554
|
+
}, []);
|
|
555
|
+
manifest.remotes = Object.keys(stats.remotes).reduce(function(sum, cur) {
|
|
556
|
+
var statsRemote = manifest.remotes[cur];
|
|
557
|
+
// @ts-ignore version/entry will be added as follow
|
|
558
|
+
var remote = {
|
|
559
|
+
federationContainerName: statsRemote.federationContainerName,
|
|
560
|
+
moduleName: statsRemote.moduleName,
|
|
561
|
+
alias: statsRemote.alias
|
|
562
|
+
};
|
|
563
|
+
if ("entry" in statsRemote) {
|
|
564
|
+
// @ts-ignore
|
|
565
|
+
remote.entry = statsRemote.entry;
|
|
566
|
+
} else if ("version" in statsRemote) {
|
|
567
|
+
// @ts-ignore
|
|
568
|
+
remote.entry = statsRemote.version;
|
|
569
|
+
}
|
|
570
|
+
sum.push(remote);
|
|
571
|
+
return sum;
|
|
572
|
+
}, []);
|
|
573
|
+
this._manifest = manifest;
|
|
574
|
+
var manifestFileName = this.fileName;
|
|
575
|
+
compilation.emitAsset(manifestFileName, new compiler.webpack.sources.RawSource(JSON.stringify(manifest, null, 2)));
|
|
576
|
+
if (isDev()) {
|
|
577
|
+
console.log(chalk(_templateObject$1(), PLUGIN_IDENTIFIER, publicPath, manifestFileName));
|
|
578
|
+
}
|
|
735
579
|
}
|
|
736
580
|
}
|
|
737
581
|
]);
|
|
@@ -1998,10 +1842,8 @@ var StatsPlugin = /*#__PURE__*/ function() {
|
|
|
1998
1842
|
_define_property(this, "_statsManager", new StatsManager());
|
|
1999
1843
|
_define_property(this, "_manifestManager", new ManifestManager());
|
|
2000
1844
|
_define_property(this, "_enable", true);
|
|
2001
|
-
_define_property(this, "_bundler", "webpack");
|
|
2002
1845
|
try {
|
|
2003
1846
|
this._options = options;
|
|
2004
|
-
this._bundler = bundler;
|
|
2005
1847
|
this._statsManager.init(this._options, {
|
|
2006
1848
|
pluginVersion: pluginVersion,
|
|
2007
1849
|
bundler: bundler
|
|
@@ -2052,9 +1894,7 @@ var StatsPlugin = /*#__PURE__*/ function() {
|
|
|
2052
1894
|
compilation: compilation,
|
|
2053
1895
|
stats: stats,
|
|
2054
1896
|
publicPath: _this1._statsManager.getPublicPath(compiler),
|
|
2055
|
-
compiler: compiler
|
|
2056
|
-
bundler: _this1._bundler,
|
|
2057
|
-
additionalData: typeof _this1._options.manifest === "object" ? _this1._options.manifest.additionalData : undefined
|
|
1897
|
+
compiler: compiler
|
|
2058
1898
|
});
|
|
2059
1899
|
_state.label = 2;
|
|
2060
1900
|
case 2:
|
|
@@ -5,8 +5,6 @@ interface GenerateManifestOptions {
|
|
|
5
5
|
stats: Stats;
|
|
6
6
|
publicPath: string;
|
|
7
7
|
compiler: Compiler;
|
|
8
|
-
bundler: 'webpack' | 'rspack';
|
|
9
|
-
additionalData?: moduleFederationPlugin.PluginManifestOptions['additionalData'];
|
|
10
8
|
}
|
|
11
9
|
declare class ManifestManager {
|
|
12
10
|
private _options;
|
|
@@ -14,6 +12,6 @@ declare class ManifestManager {
|
|
|
14
12
|
get manifest(): Manifest | undefined;
|
|
15
13
|
init(options: moduleFederationPlugin.ModuleFederationPluginOptions): void;
|
|
16
14
|
get fileName(): string;
|
|
17
|
-
generateManifest(options: GenerateManifestOptions):
|
|
15
|
+
generateManifest(options: GenerateManifestOptions): void;
|
|
18
16
|
}
|
|
19
17
|
export { ManifestManager };
|
|
@@ -6,7 +6,6 @@ export declare class StatsPlugin implements WebpackPluginInstance {
|
|
|
6
6
|
private _statsManager;
|
|
7
7
|
private _manifestManager;
|
|
8
8
|
private _enable;
|
|
9
|
-
private _bundler;
|
|
10
9
|
constructor(options: moduleFederationPlugin.ModuleFederationPluginOptions, { pluginVersion, bundler, }: {
|
|
11
10
|
pluginVersion: string;
|
|
12
11
|
bundler: 'webpack' | 'rspack';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/manifest",
|
|
3
|
-
"version": "0.0.0-next-
|
|
3
|
+
"version": "0.0.0-next-20240412103714",
|
|
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-
|
|
28
|
-
"@module-federation/dts-plugin": "0.0.0-next-
|
|
29
|
-
"@module-federation/managers": "0.0.0-next-
|
|
27
|
+
"@module-federation/sdk": "0.0.0-next-20240412103714",
|
|
28
|
+
"@module-federation/dts-plugin": "0.0.0-next-20240412103714",
|
|
29
|
+
"@module-federation/managers": "0.0.0-next-20240412103714"
|
|
30
30
|
},
|
|
31
31
|
"exports": {
|
|
32
32
|
".": {
|