@module-federation/manifest 0.6.4 → 0.6.6
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 +18 -6
- package/dist/index.esm.js +17 -6
- package/dist/package.json +1 -1
- package/package.json +4 -4
package/dist/index.cjs.js
CHANGED
|
@@ -2,16 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var chalk = require('chalk');
|
|
6
5
|
var path = require('path');
|
|
6
|
+
var fs = require('fs');
|
|
7
|
+
var chalk = require('chalk');
|
|
7
8
|
var sdk = require('@module-federation/sdk');
|
|
8
9
|
var core = require('@module-federation/dts-plugin/core');
|
|
9
10
|
var managers = require('@module-federation/managers');
|
|
10
11
|
|
|
11
12
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
13
|
|
|
13
|
-
var chalk__default = /*#__PURE__*/_interopDefaultLegacy(chalk);
|
|
14
14
|
var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
|
|
15
|
+
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
|
|
16
|
+
var chalk__default = /*#__PURE__*/_interopDefaultLegacy(chalk);
|
|
15
17
|
|
|
16
18
|
var PLUGIN_IDENTIFIER = 'Module Federation Manifest Plugin';
|
|
17
19
|
var HOT_UPDATE_SUFFIX = '.hot-update';
|
|
@@ -420,12 +422,12 @@ function getTypesMetaInfo(pluginOptions, context) {
|
|
|
420
422
|
var _retrieveTypesAssetsInfo = core.retrieveTypesAssetsInfo(_object_spread_props$2(_object_spread$3({}, normalizedRemote), {
|
|
421
423
|
context: context,
|
|
422
424
|
moduleFederationConfig: pluginOptions
|
|
423
|
-
})), apiFileName = _retrieveTypesAssetsInfo.apiFileName, zipName = _retrieveTypesAssetsInfo.zipName;
|
|
425
|
+
})), apiFileName = _retrieveTypesAssetsInfo.apiFileName, zipName = _retrieveTypesAssetsInfo.zipName, zipPrefix = _retrieveTypesAssetsInfo.zipPrefix;
|
|
424
426
|
return {
|
|
425
427
|
path: '',
|
|
426
428
|
name: '',
|
|
427
|
-
zip: zipName,
|
|
428
|
-
api: apiFileName
|
|
429
|
+
zip: path__default["default"].join(zipPrefix, zipName),
|
|
430
|
+
api: path__default["default"].join(zipPrefix, apiFileName)
|
|
429
431
|
};
|
|
430
432
|
} catch (err) {
|
|
431
433
|
console.warn(chalk__default["default"](_templateObject$2(), PLUGIN_IDENTIFIER, err));
|
|
@@ -657,7 +659,7 @@ var ManifestManager = /*#__PURE__*/ function() {
|
|
|
657
659
|
var extraOptions = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
658
660
|
var _this = this;
|
|
659
661
|
return _async_to_generator$2(function() {
|
|
660
|
-
var compilation, publicPath, stats, compiler, bundler, additionalData, disableEmit, manifest, manifestFileName, ret;
|
|
662
|
+
var compilation, publicPath, stats, compiler, bundler, additionalData, disableEmit, manifest, prefetchInterface, prefetchFilePath, existPrefetch, content, manifestFileName, ret;
|
|
661
663
|
return _ts_generator$2(this, function(_state) {
|
|
662
664
|
switch(_state.label){
|
|
663
665
|
case 0:
|
|
@@ -704,6 +706,16 @@ var ManifestManager = /*#__PURE__*/ function() {
|
|
|
704
706
|
sum.push(remote);
|
|
705
707
|
return sum;
|
|
706
708
|
}, []);
|
|
709
|
+
prefetchInterface = false;
|
|
710
|
+
prefetchFilePath = path__default["default"].resolve(compiler.options.context || process.cwd(), "node_modules/.mf/".concat(sdk.encodeName(stats.name), "/").concat(sdk.MFPrefetchCommon.fileName));
|
|
711
|
+
existPrefetch = fs__default["default"].existsSync(prefetchFilePath);
|
|
712
|
+
if (existPrefetch) {
|
|
713
|
+
content = fs__default["default"].readFileSync(prefetchFilePath).toString();
|
|
714
|
+
if (content) {
|
|
715
|
+
prefetchInterface = true;
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
stats.metaData.prefetchInterface = prefetchInterface;
|
|
707
719
|
_this._manifest = manifest;
|
|
708
720
|
manifestFileName = _this.fileName;
|
|
709
721
|
if (!additionalData) return [
|
package/dist/index.esm.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
1
|
import path from 'path';
|
|
3
|
-
import
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import { StatsFileName, ManifestFileName, simpleJoinRemoteEntry, normalizeOptions, encodeName, MFPrefetchCommon } from '@module-federation/sdk';
|
|
4
5
|
import { isTSProject, retrieveTypesAssetsInfo } from '@module-federation/dts-plugin/core';
|
|
5
6
|
import { RemoteManager, SharedManager, ContainerManager, PKGJsonManager, utils } from '@module-federation/managers';
|
|
6
7
|
|
|
@@ -411,12 +412,12 @@ function getTypesMetaInfo(pluginOptions, context) {
|
|
|
411
412
|
var _retrieveTypesAssetsInfo = retrieveTypesAssetsInfo(_object_spread_props$2(_object_spread$3({}, normalizedRemote), {
|
|
412
413
|
context: context,
|
|
413
414
|
moduleFederationConfig: pluginOptions
|
|
414
|
-
})), apiFileName = _retrieveTypesAssetsInfo.apiFileName, zipName = _retrieveTypesAssetsInfo.zipName;
|
|
415
|
+
})), apiFileName = _retrieveTypesAssetsInfo.apiFileName, zipName = _retrieveTypesAssetsInfo.zipName, zipPrefix = _retrieveTypesAssetsInfo.zipPrefix;
|
|
415
416
|
return {
|
|
416
417
|
path: '',
|
|
417
418
|
name: '',
|
|
418
|
-
zip: zipName,
|
|
419
|
-
api: apiFileName
|
|
419
|
+
zip: path.join(zipPrefix, zipName),
|
|
420
|
+
api: path.join(zipPrefix, apiFileName)
|
|
420
421
|
};
|
|
421
422
|
} catch (err) {
|
|
422
423
|
console.warn(chalk(_templateObject$2(), PLUGIN_IDENTIFIER, err));
|
|
@@ -648,7 +649,7 @@ var ManifestManager = /*#__PURE__*/ function() {
|
|
|
648
649
|
var extraOptions = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
649
650
|
var _this = this;
|
|
650
651
|
return _async_to_generator$2(function() {
|
|
651
|
-
var compilation, publicPath, stats, compiler, bundler, additionalData, disableEmit, manifest, manifestFileName, ret;
|
|
652
|
+
var compilation, publicPath, stats, compiler, bundler, additionalData, disableEmit, manifest, prefetchInterface, prefetchFilePath, existPrefetch, content, manifestFileName, ret;
|
|
652
653
|
return _ts_generator$2(this, function(_state) {
|
|
653
654
|
switch(_state.label){
|
|
654
655
|
case 0:
|
|
@@ -695,6 +696,16 @@ var ManifestManager = /*#__PURE__*/ function() {
|
|
|
695
696
|
sum.push(remote);
|
|
696
697
|
return sum;
|
|
697
698
|
}, []);
|
|
699
|
+
prefetchInterface = false;
|
|
700
|
+
prefetchFilePath = path.resolve(compiler.options.context || process.cwd(), "node_modules/.mf/".concat(encodeName(stats.name), "/").concat(MFPrefetchCommon.fileName));
|
|
701
|
+
existPrefetch = fs.existsSync(prefetchFilePath);
|
|
702
|
+
if (existPrefetch) {
|
|
703
|
+
content = fs.readFileSync(prefetchFilePath).toString();
|
|
704
|
+
if (content) {
|
|
705
|
+
prefetchInterface = true;
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
stats.metaData.prefetchInterface = prefetchInterface;
|
|
698
709
|
_this._manifest = manifest;
|
|
699
710
|
manifestFileName = _this.fileName;
|
|
700
711
|
if (!additionalData) return [
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/manifest",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.6",
|
|
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.6.
|
|
28
|
-
"@module-federation/dts-plugin": "0.6.
|
|
29
|
-
"@module-federation/managers": "0.6.
|
|
27
|
+
"@module-federation/sdk": "0.6.6",
|
|
28
|
+
"@module-federation/dts-plugin": "0.6.6",
|
|
29
|
+
"@module-federation/managers": "0.6.6"
|
|
30
30
|
},
|
|
31
31
|
"exports": {
|
|
32
32
|
".": {
|