@module-federation/metro 2.6.0 → 2.7.0
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/commands/bundle-host/index.js +12 -8
- package/dist/commands/bundle-host/index.mjs +3 -4
- package/dist/commands/bundle-host/options.js +12 -8
- package/dist/commands/bundle-host/options.mjs +2 -3
- package/dist/commands/bundle-host/types.js +2 -2
- package/dist/commands/bundle-host/types.mjs +1 -2
- package/dist/commands/bundle-remote/index.js +12 -8
- package/dist/commands/bundle-remote/index.mjs +6 -6
- package/dist/commands/bundle-remote/options.js +15 -11
- package/dist/commands/bundle-remote/options.mjs +4 -5
- package/dist/commands/bundle-remote/types.js +2 -2
- package/dist/commands/bundle-remote/types.mjs +1 -2
- package/dist/commands/index.js +14 -10
- package/dist/commands/index.mjs +3 -3
- package/dist/commands/types.js +2 -2
- package/dist/commands/types.mjs +1 -2
- package/dist/commands/utils/create-module-path-remapper.js +15 -11
- package/dist/commands/utils/create-module-path-remapper.mjs +1 -2
- package/dist/commands/utils/create-resolver.js +15 -11
- package/dist/commands/utils/create-resolver.mjs +1 -2
- package/dist/commands/utils/get-community-plugin.js +12 -8
- package/dist/commands/utils/get-community-plugin.mjs +2 -2
- package/dist/commands/utils/load-metro-config.js +15 -14
- package/dist/commands/utils/load-metro-config.mjs +9 -11
- package/dist/commands/utils/path-utils.js +12 -8
- package/dist/commands/utils/path-utils.mjs +1 -2
- package/dist/commands/utils/save-bundle-and-map.js +12 -8
- package/dist/commands/utils/save-bundle-and-map.mjs +1 -2
- package/dist/index.js +14 -10
- package/dist/index.mjs +3 -5
- package/dist/logger.js +12 -8
- package/dist/logger.mjs +2 -3
- package/dist/plugin/babel-transformer.js +12 -8
- package/dist/plugin/babel-transformer.mjs +2 -2
- package/dist/plugin/constants.js +24 -20
- package/dist/plugin/constants.mjs +1 -2
- package/dist/plugin/generators.js +16 -12
- package/dist/plugin/generators.mjs +2 -2
- package/dist/plugin/helpers.js +17 -13
- package/dist/plugin/helpers.mjs +1 -2
- package/dist/plugin/index.js +13 -9
- package/dist/plugin/index.mjs +3 -3
- package/dist/plugin/manifest-middleware.js +12 -8
- package/dist/plugin/manifest-middleware.mjs +1 -2
- package/dist/plugin/manifest.js +19 -16
- package/dist/plugin/manifest.mjs +5 -7
- package/dist/plugin/normalize-extra-options.js +16 -12
- package/dist/plugin/normalize-extra-options.mjs +2 -3
- package/dist/plugin/normalize-options.js +13 -12
- package/dist/plugin/normalize-options.mjs +3 -6
- package/dist/plugin/resolver.js +12 -8
- package/dist/plugin/resolver.mjs +5 -6
- package/dist/plugin/rewrite-request.js +15 -11
- package/dist/plugin/rewrite-request.mjs +4 -5
- package/dist/plugin/serializer.js +13 -9
- package/dist/plugin/serializer.mjs +2 -3
- package/dist/plugin/validate-options.js +12 -8
- package/dist/plugin/validate-options.mjs +1 -2
- package/dist/types.js +2 -2
- package/dist/types.mjs +1 -2
- package/dist/utils/errors.js +16 -12
- package/dist/utils/errors.mjs +1 -2
- package/dist/utils/federated-remote-types.js +103 -122
- package/dist/utils/federated-remote-types.mjs +2 -3
- package/dist/utils/index.js +14 -10
- package/dist/utils/index.mjs +3 -5
- package/dist/utils/metro-compat.js +19 -15
- package/dist/utils/metro-compat.mjs +2 -2
- package/dist/utils/vm-manager.js +14 -12
- package/dist/utils/vm-manager.mjs +3 -6
- package/package.json +8 -8
package/dist/plugin/index.js
CHANGED
|
@@ -10,11 +10,15 @@ var __webpack_require__ = {};
|
|
|
10
10
|
};
|
|
11
11
|
})();
|
|
12
12
|
(()=>{
|
|
13
|
-
__webpack_require__.d = (exports1,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
14
|
+
var define = (defs, kind)=>{
|
|
15
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
[kind]: defs[key]
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
define(getters, "get");
|
|
21
|
+
define(values, "value");
|
|
18
22
|
};
|
|
19
23
|
})();
|
|
20
24
|
(()=>{
|
|
@@ -22,7 +26,7 @@ var __webpack_require__ = {};
|
|
|
22
26
|
})();
|
|
23
27
|
(()=>{
|
|
24
28
|
__webpack_require__.r = (exports1)=>{
|
|
25
|
-
if (
|
|
29
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
30
|
value: 'Module'
|
|
27
31
|
});
|
|
28
32
|
Object.defineProperty(exports1, '__esModule', {
|
|
@@ -54,7 +58,7 @@ const external_serializer_js_namespaceObject = require("./serializer.js");
|
|
|
54
58
|
const external_validate_options_js_namespaceObject = require("./validate-options.js");
|
|
55
59
|
function withModuleFederation(config, federationOptions, extraOptions) {
|
|
56
60
|
if ((0, external_helpers_js_namespaceObject.isUsingMFCommand)()) return augmentConfig(config, federationOptions, extraOptions);
|
|
57
|
-
console.warn(external_node_util_default().styleText('yellow', 'Warning: Module Federation build is disabled for this command.\n') + external_node_util_default().styleText('yellow', 'To enable Module Federation, please use one of the dedicated bundle commands:\n') + ` ${external_node_util_default().styleText('dim',
|
|
61
|
+
console.warn(external_node_util_default().styleText('yellow', 'Warning: Module Federation build is disabled for this command.\n') + external_node_util_default().styleText('yellow', 'To enable Module Federation, please use one of the dedicated bundle commands:\n') + ` ${external_node_util_default().styleText('dim', '•')} bundle-mf-host` + external_node_util_default().styleText('dim', ' - for bundling a host application\n') + ` ${external_node_util_default().styleText('dim', '•')} bundle-mf-remote` + external_node_util_default().styleText('dim', ' - for bundling a remote application\n'));
|
|
58
62
|
return config;
|
|
59
63
|
}
|
|
60
64
|
function augmentConfig(config, federationOptions, extraOptions) {
|
|
@@ -207,9 +211,9 @@ function getOriginalEntry(projectRoot, entryFilename) {
|
|
|
207
211
|
};
|
|
208
212
|
}
|
|
209
213
|
exports.withModuleFederation = __webpack_exports__.withModuleFederation;
|
|
210
|
-
for(var
|
|
214
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
211
215
|
"withModuleFederation"
|
|
212
|
-
].indexOf(
|
|
216
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
213
217
|
Object.defineProperty(exports, '__esModule', {
|
|
214
218
|
value: true
|
|
215
219
|
});
|
package/dist/plugin/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import __rslib_shim_module__ from
|
|
2
|
-
const require = /*#__PURE__*/ __rslib_shim_module__.createRequire(import.meta.url);
|
|
1
|
+
import __rslib_shim_module__ from "node:module";
|
|
2
|
+
const require = /*#__PURE__*/ __rslib_shim_module__.createRequire(/*#__PURE__*/ (()=>import.meta.url)());
|
|
3
3
|
import node_path from "node:path";
|
|
4
4
|
import { promises } from "node:fs";
|
|
5
5
|
import node_util from "node:util";
|
|
@@ -17,7 +17,7 @@ import { getModuleFederationSerializer } from "./serializer.mjs";
|
|
|
17
17
|
import { validateOptions } from "./validate-options.mjs";
|
|
18
18
|
function withModuleFederation(config, federationOptions, extraOptions) {
|
|
19
19
|
if (isUsingMFCommand()) return augmentConfig(config, federationOptions, extraOptions);
|
|
20
|
-
console.warn(node_util.styleText('yellow', 'Warning: Module Federation build is disabled for this command.\n') + node_util.styleText('yellow', 'To enable Module Federation, please use one of the dedicated bundle commands:\n') + ` ${node_util.styleText('dim',
|
|
20
|
+
console.warn(node_util.styleText('yellow', 'Warning: Module Federation build is disabled for this command.\n') + node_util.styleText('yellow', 'To enable Module Federation, please use one of the dedicated bundle commands:\n') + ` ${node_util.styleText('dim', '•')} bundle-mf-host` + node_util.styleText('dim', ' - for bundling a host application\n') + ` ${node_util.styleText('dim', '•')} bundle-mf-remote` + node_util.styleText('dim', ' - for bundling a remote application\n'));
|
|
21
21
|
return config;
|
|
22
22
|
}
|
|
23
23
|
function augmentConfig(config, federationOptions, extraOptions) {
|
|
@@ -10,11 +10,15 @@ var __webpack_require__ = {};
|
|
|
10
10
|
};
|
|
11
11
|
})();
|
|
12
12
|
(()=>{
|
|
13
|
-
__webpack_require__.d = (exports1,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
14
|
+
var define = (defs, kind)=>{
|
|
15
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
[kind]: defs[key]
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
define(getters, "get");
|
|
21
|
+
define(values, "value");
|
|
18
22
|
};
|
|
19
23
|
})();
|
|
20
24
|
(()=>{
|
|
@@ -22,7 +26,7 @@ var __webpack_require__ = {};
|
|
|
22
26
|
})();
|
|
23
27
|
(()=>{
|
|
24
28
|
__webpack_require__.r = (exports1)=>{
|
|
25
|
-
if (
|
|
29
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
30
|
value: 'Module'
|
|
27
31
|
});
|
|
28
32
|
Object.defineProperty(exports1, '__esModule', {
|
|
@@ -205,9 +209,9 @@ function getBoolean(params, key, defaultValue) {
|
|
|
205
209
|
return 'true' === value || '1' === value;
|
|
206
210
|
}
|
|
207
211
|
exports.createManifestMiddleware = __webpack_exports__.createManifestMiddleware;
|
|
208
|
-
for(var
|
|
212
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
209
213
|
"createManifestMiddleware"
|
|
210
|
-
].indexOf(
|
|
214
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
211
215
|
Object.defineProperty(exports, '__esModule', {
|
|
212
216
|
value: true
|
|
213
217
|
});
|
package/dist/plugin/manifest.js
CHANGED
|
@@ -10,11 +10,15 @@ var __webpack_require__ = {};
|
|
|
10
10
|
};
|
|
11
11
|
})();
|
|
12
12
|
(()=>{
|
|
13
|
-
__webpack_require__.d = (exports1,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
14
|
+
var define = (defs, kind)=>{
|
|
15
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
[kind]: defs[key]
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
define(getters, "get");
|
|
21
|
+
define(values, "value");
|
|
18
22
|
};
|
|
19
23
|
})();
|
|
20
24
|
(()=>{
|
|
@@ -22,7 +26,7 @@ var __webpack_require__ = {};
|
|
|
22
26
|
})();
|
|
23
27
|
(()=>{
|
|
24
28
|
__webpack_require__.r = (exports1)=>{
|
|
25
|
-
if (
|
|
29
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
30
|
value: 'Module'
|
|
27
31
|
});
|
|
28
32
|
Object.defineProperty(exports1, '__esModule', {
|
|
@@ -33,11 +37,11 @@ var __webpack_require__ = {};
|
|
|
33
37
|
var __webpack_exports__ = {};
|
|
34
38
|
__webpack_require__.r(__webpack_exports__);
|
|
35
39
|
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
-
getSharedVirtualModulePath: ()=>getSharedVirtualModulePath,
|
|
37
40
|
createManifest: ()=>createManifest,
|
|
41
|
+
getSharedVirtualModuleName: ()=>getSharedVirtualModuleName,
|
|
42
|
+
getSharedVirtualModulePath: ()=>getSharedVirtualModulePath,
|
|
38
43
|
recordBundleHash: ()=>recordBundleHash,
|
|
39
|
-
updateManifest: ()=>updateManifest
|
|
40
|
-
getSharedVirtualModuleName: ()=>getSharedVirtualModuleName
|
|
44
|
+
updateManifest: ()=>updateManifest
|
|
41
45
|
});
|
|
42
46
|
const external_node_crypto_namespaceObject = require("node:crypto");
|
|
43
47
|
var external_node_crypto_default = /*#__PURE__*/ __webpack_require__.n(external_node_crypto_namespaceObject);
|
|
@@ -55,11 +59,10 @@ function createManifest(options, mfMetroPath, hashesOrOptions, manifestOptions)
|
|
|
55
59
|
return manifestPath;
|
|
56
60
|
}
|
|
57
61
|
function updateManifest(manifestPath, options, hashesOrOptions, manifestOptions) {
|
|
58
|
-
var _existingManifest_metaData;
|
|
59
62
|
const { hashes, options: generationOptions } = normalizeManifestArgs(hashesOrOptions, manifestOptions);
|
|
60
63
|
const manifest = generateManifest(options, hashes, generationOptions);
|
|
61
64
|
const existingManifest = readManifest(manifestPath);
|
|
62
|
-
if (
|
|
65
|
+
if (existingManifest?.metaData?.types) manifest.metaData.types = {
|
|
63
66
|
...manifest.metaData.types,
|
|
64
67
|
...existingManifest.metaData.types
|
|
65
68
|
};
|
|
@@ -88,7 +91,7 @@ function generateMetaData(config, hashes) {
|
|
|
88
91
|
buildInfo: {
|
|
89
92
|
buildVersion: '1.0.0',
|
|
90
93
|
buildName: config.name,
|
|
91
|
-
hash:
|
|
94
|
+
hash: hashes?.get(`container:${config.name}`) ?? ''
|
|
92
95
|
},
|
|
93
96
|
remoteEntry: {
|
|
94
97
|
name: config.filename,
|
|
@@ -116,7 +119,7 @@ function generateExposes(config, hashes) {
|
|
|
116
119
|
name: formatKey,
|
|
117
120
|
path: expose,
|
|
118
121
|
assets,
|
|
119
|
-
hash:
|
|
122
|
+
hash: hashes?.get(`expose:${formatKey}`) ?? ''
|
|
120
123
|
};
|
|
121
124
|
});
|
|
122
125
|
}
|
|
@@ -139,7 +142,7 @@ function generateShared(config, hashes, manifestOptions = {}) {
|
|
|
139
142
|
version: getManifestVersion(config.shared[sharedName].version),
|
|
140
143
|
requiredVersion: getManifestRequiredVersion(config.shared[sharedName].requiredVersion),
|
|
141
144
|
singleton: config.shared[sharedName].singleton,
|
|
142
|
-
hash:
|
|
145
|
+
hash: hashes?.get(`shared:${sharedName}`) ?? '',
|
|
143
146
|
assets
|
|
144
147
|
};
|
|
145
148
|
});
|
|
@@ -231,13 +234,13 @@ exports.getSharedVirtualModuleName = __webpack_exports__.getSharedVirtualModuleN
|
|
|
231
234
|
exports.getSharedVirtualModulePath = __webpack_exports__.getSharedVirtualModulePath;
|
|
232
235
|
exports.recordBundleHash = __webpack_exports__.recordBundleHash;
|
|
233
236
|
exports.updateManifest = __webpack_exports__.updateManifest;
|
|
234
|
-
for(var
|
|
237
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
235
238
|
"createManifest",
|
|
236
239
|
"getSharedVirtualModuleName",
|
|
237
240
|
"getSharedVirtualModulePath",
|
|
238
241
|
"recordBundleHash",
|
|
239
242
|
"updateManifest"
|
|
240
|
-
].indexOf(
|
|
243
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
241
244
|
Object.defineProperty(exports, '__esModule', {
|
|
242
245
|
value: true
|
|
243
246
|
});
|
package/dist/plugin/manifest.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
/*#__PURE__*/ import.meta.url;
|
|
1
|
+
import "node:module";
|
|
3
2
|
import node_crypto from "node:crypto";
|
|
4
3
|
import node_fs from "node:fs";
|
|
5
4
|
import node_path from "node:path";
|
|
@@ -13,11 +12,10 @@ function createManifest(options, mfMetroPath, hashesOrOptions, manifestOptions)
|
|
|
13
12
|
return manifestPath;
|
|
14
13
|
}
|
|
15
14
|
function updateManifest(manifestPath, options, hashesOrOptions, manifestOptions) {
|
|
16
|
-
var _existingManifest_metaData;
|
|
17
15
|
const { hashes, options: generationOptions } = normalizeManifestArgs(hashesOrOptions, manifestOptions);
|
|
18
16
|
const manifest = generateManifest(options, hashes, generationOptions);
|
|
19
17
|
const existingManifest = readManifest(manifestPath);
|
|
20
|
-
if (
|
|
18
|
+
if (existingManifest?.metaData?.types) manifest.metaData.types = {
|
|
21
19
|
...manifest.metaData.types,
|
|
22
20
|
...existingManifest.metaData.types
|
|
23
21
|
};
|
|
@@ -46,7 +44,7 @@ function generateMetaData(config, hashes) {
|
|
|
46
44
|
buildInfo: {
|
|
47
45
|
buildVersion: '1.0.0',
|
|
48
46
|
buildName: config.name,
|
|
49
|
-
hash:
|
|
47
|
+
hash: hashes?.get(`container:${config.name}`) ?? ''
|
|
50
48
|
},
|
|
51
49
|
remoteEntry: {
|
|
52
50
|
name: config.filename,
|
|
@@ -74,7 +72,7 @@ function generateExposes(config, hashes) {
|
|
|
74
72
|
name: formatKey,
|
|
75
73
|
path: expose,
|
|
76
74
|
assets,
|
|
77
|
-
hash:
|
|
75
|
+
hash: hashes?.get(`expose:${formatKey}`) ?? ''
|
|
78
76
|
};
|
|
79
77
|
});
|
|
80
78
|
}
|
|
@@ -97,7 +95,7 @@ function generateShared(config, hashes, manifestOptions = {}) {
|
|
|
97
95
|
version: getManifestVersion(config.shared[sharedName].version),
|
|
98
96
|
requiredVersion: getManifestRequiredVersion(config.shared[sharedName].requiredVersion),
|
|
99
97
|
singleton: config.shared[sharedName].singleton,
|
|
100
|
-
hash:
|
|
98
|
+
hash: hashes?.get(`shared:${sharedName}`) ?? '',
|
|
101
99
|
assets
|
|
102
100
|
};
|
|
103
101
|
});
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
3
|
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
9
13
|
};
|
|
10
14
|
})();
|
|
11
15
|
(()=>{
|
|
@@ -13,7 +17,7 @@ var __webpack_require__ = {};
|
|
|
13
17
|
})();
|
|
14
18
|
(()=>{
|
|
15
19
|
__webpack_require__.r = (exports1)=>{
|
|
16
|
-
if (
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
21
|
value: 'Module'
|
|
18
22
|
});
|
|
19
23
|
Object.defineProperty(exports1, '__esModule', {
|
|
@@ -23,9 +27,6 @@ var __webpack_require__ = {};
|
|
|
23
27
|
})();
|
|
24
28
|
var __webpack_exports__ = {};
|
|
25
29
|
__webpack_require__.r(__webpack_exports__);
|
|
26
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
normalizeExtraOptions: ()=>normalizeExtraOptions
|
|
28
|
-
});
|
|
29
30
|
function normalizeExtraOptions(extraOptions) {
|
|
30
31
|
return {
|
|
31
32
|
...extraOptions,
|
|
@@ -33,14 +34,17 @@ function normalizeExtraOptions(extraOptions) {
|
|
|
33
34
|
unstable_patchHMRClient: false,
|
|
34
35
|
unstable_patchInitializeCore: false,
|
|
35
36
|
unstable_patchRuntimeRequire: false,
|
|
36
|
-
...
|
|
37
|
+
...extraOptions?.flags
|
|
37
38
|
}
|
|
38
39
|
};
|
|
39
40
|
}
|
|
41
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
42
|
+
normalizeExtraOptions: ()=>normalizeExtraOptions
|
|
43
|
+
});
|
|
40
44
|
exports.normalizeExtraOptions = __webpack_exports__.normalizeExtraOptions;
|
|
41
|
-
for(var
|
|
45
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
42
46
|
"normalizeExtraOptions"
|
|
43
|
-
].indexOf(
|
|
47
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
44
48
|
Object.defineProperty(exports, '__esModule', {
|
|
45
49
|
value: true
|
|
46
50
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
/*#__PURE__*/ import.meta.url;
|
|
1
|
+
import "node:module";
|
|
3
2
|
function normalizeExtraOptions(extraOptions) {
|
|
4
3
|
return {
|
|
5
4
|
...extraOptions,
|
|
@@ -7,7 +6,7 @@ function normalizeExtraOptions(extraOptions) {
|
|
|
7
6
|
unstable_patchHMRClient: false,
|
|
8
7
|
unstable_patchInitializeCore: false,
|
|
9
8
|
unstable_patchRuntimeRequire: false,
|
|
10
|
-
...
|
|
9
|
+
...extraOptions?.flags
|
|
11
10
|
}
|
|
12
11
|
};
|
|
13
12
|
}
|
|
@@ -10,11 +10,15 @@ var __webpack_require__ = {};
|
|
|
10
10
|
};
|
|
11
11
|
})();
|
|
12
12
|
(()=>{
|
|
13
|
-
__webpack_require__.d = (exports1,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
14
|
+
var define = (defs, kind)=>{
|
|
15
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
[kind]: defs[key]
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
define(getters, "get");
|
|
21
|
+
define(values, "value");
|
|
18
22
|
};
|
|
19
23
|
})();
|
|
20
24
|
(()=>{
|
|
@@ -22,7 +26,7 @@ var __webpack_require__ = {};
|
|
|
22
26
|
})();
|
|
23
27
|
(()=>{
|
|
24
28
|
__webpack_require__.r = (exports1)=>{
|
|
25
|
-
if (
|
|
29
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
30
|
value: 'Module'
|
|
27
31
|
});
|
|
28
32
|
Object.defineProperty(exports1, '__esModule', {
|
|
@@ -80,10 +84,7 @@ function getNormalizedShared(options, projectRoot) {
|
|
|
80
84
|
return acc;
|
|
81
85
|
}, {});
|
|
82
86
|
if (!options.exposes) for (const sharedName of Object.keys(shared))shared[sharedName].eager = true;
|
|
83
|
-
for (const sharedName of Object.keys(shared))if (!shared[sharedName].requiredVersion)
|
|
84
|
-
var _pkg_dependencies, _pkg_devDependencies;
|
|
85
|
-
shared[sharedName].requiredVersion = (null == (_pkg_dependencies = pkg.dependencies) ? void 0 : _pkg_dependencies[sharedName]) || (null == (_pkg_devDependencies = pkg.devDependencies) ? void 0 : _pkg_devDependencies[sharedName]);
|
|
86
|
-
}
|
|
87
|
+
for (const sharedName of Object.keys(shared))if (!shared[sharedName].requiredVersion) shared[sharedName].requiredVersion = pkg.dependencies?.[sharedName] || pkg.devDependencies?.[sharedName];
|
|
87
88
|
if (!shared['react-native/Libraries/Network/RCTNetworking']) {
|
|
88
89
|
const reactNativeSharedConfig = shared['react-native'];
|
|
89
90
|
shared['react-native/Libraries/Network/RCTNetworking'] = reactNativeSharedConfig;
|
|
@@ -130,9 +131,9 @@ function getProjectPackageJson(projectRoot) {
|
|
|
130
131
|
return JSON.parse(external_node_fs_default().readFileSync(packageJsonPath, 'utf-8'));
|
|
131
132
|
}
|
|
132
133
|
exports.normalizeOptions = __webpack_exports__.normalizeOptions;
|
|
133
|
-
for(var
|
|
134
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
134
135
|
"normalizeOptions"
|
|
135
|
-
].indexOf(
|
|
136
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
136
137
|
Object.defineProperty(exports, '__esModule', {
|
|
137
138
|
value: true
|
|
138
139
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import __rslib_shim_module__ from
|
|
2
|
-
const require = /*#__PURE__*/ __rslib_shim_module__.createRequire(import.meta.url);
|
|
1
|
+
import __rslib_shim_module__ from "node:module";
|
|
2
|
+
const require = /*#__PURE__*/ __rslib_shim_module__.createRequire(/*#__PURE__*/ (()=>import.meta.url)());
|
|
3
3
|
import node_fs from "node:fs";
|
|
4
4
|
import node_path from "node:path";
|
|
5
5
|
import { DEFAULT_ENTRY_FILENAME } from "./constants.mjs";
|
|
@@ -43,10 +43,7 @@ function getNormalizedShared(options, projectRoot) {
|
|
|
43
43
|
return acc;
|
|
44
44
|
}, {});
|
|
45
45
|
if (!options.exposes) for (const sharedName of Object.keys(shared))shared[sharedName].eager = true;
|
|
46
|
-
for (const sharedName of Object.keys(shared))if (!shared[sharedName].requiredVersion)
|
|
47
|
-
var _pkg_dependencies, _pkg_devDependencies;
|
|
48
|
-
shared[sharedName].requiredVersion = (null == (_pkg_dependencies = pkg.dependencies) ? void 0 : _pkg_dependencies[sharedName]) || (null == (_pkg_devDependencies = pkg.devDependencies) ? void 0 : _pkg_devDependencies[sharedName]);
|
|
49
|
-
}
|
|
46
|
+
for (const sharedName of Object.keys(shared))if (!shared[sharedName].requiredVersion) shared[sharedName].requiredVersion = pkg.dependencies?.[sharedName] || pkg.devDependencies?.[sharedName];
|
|
50
47
|
if (!shared['react-native/Libraries/Network/RCTNetworking']) {
|
|
51
48
|
const reactNativeSharedConfig = shared['react-native'];
|
|
52
49
|
shared['react-native/Libraries/Network/RCTNetworking'] = reactNativeSharedConfig;
|
package/dist/plugin/resolver.js
CHANGED
|
@@ -10,11 +10,15 @@ var __webpack_require__ = {};
|
|
|
10
10
|
};
|
|
11
11
|
})();
|
|
12
12
|
(()=>{
|
|
13
|
-
__webpack_require__.d = (exports1,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
14
|
+
var define = (defs, kind)=>{
|
|
15
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
[kind]: defs[key]
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
define(getters, "get");
|
|
21
|
+
define(values, "value");
|
|
18
22
|
};
|
|
19
23
|
})();
|
|
20
24
|
(()=>{
|
|
@@ -22,7 +26,7 @@ var __webpack_require__ = {};
|
|
|
22
26
|
})();
|
|
23
27
|
(()=>{
|
|
24
28
|
__webpack_require__.r = (exports1)=>{
|
|
25
|
-
if (
|
|
29
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
30
|
value: 'Module'
|
|
27
31
|
});
|
|
28
32
|
Object.defineProperty(exports1, '__esModule', {
|
|
@@ -191,9 +195,9 @@ function getEntryPathRegex(paths) {
|
|
|
191
195
|
return new RegExp(`^\\./${entryName}(\\.js)?$`);
|
|
192
196
|
}
|
|
193
197
|
exports.createResolveRequest = __webpack_exports__.createResolveRequest;
|
|
194
|
-
for(var
|
|
198
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
195
199
|
"createResolveRequest"
|
|
196
|
-
].indexOf(
|
|
200
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
197
201
|
Object.defineProperty(exports, '__esModule', {
|
|
198
202
|
value: true
|
|
199
203
|
});
|
package/dist/plugin/resolver.mjs
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
/*#__PURE__*/ import.meta.url;
|
|
3
|
-
import { fileURLToPath as __webpack_fileURLToPath__ } from "node:url";
|
|
4
|
-
import { dirname as __webpack_dirname__ } from "node:path";
|
|
1
|
+
import "node:module";
|
|
5
2
|
import node_path from "node:path";
|
|
6
3
|
import { ASYNC_REQUIRE, GET_DEV_SERVER_REGEX, HMR_CLIENT_REGEX, INIT_HOST, REMOTE_HMR_SETUP, REMOTE_MODULE_REGISTRY } from "./constants.mjs";
|
|
7
4
|
import { getHostEntryModule, getInitHostModule, getRemoteEntryModule, getRemoteHMRSetupModule, getRemoteModule, getRemoteModuleRegistryModule } from "./generators.mjs";
|
|
8
5
|
import { isUsingMFBundleCommand, removeExtension, toPosixPath } from "./helpers.mjs";
|
|
9
|
-
|
|
6
|
+
import { fileURLToPath as __rspack_fileURLToPath } from "node:url";
|
|
7
|
+
import { dirname as __rspack_dirname } from "node:path";
|
|
8
|
+
var __rspack_import_meta_dirname__ = __rspack_dirname(__rspack_fileURLToPath(import.meta.url));
|
|
10
9
|
function createResolveRequest({ vmManager, options, hacks, paths, isRemote, customResolver }) {
|
|
11
10
|
const hostEntryPathRegex = getEntryPathRegex({
|
|
12
11
|
entry: paths.hostEntry,
|
|
@@ -136,7 +135,7 @@ function getRemoteModulePath(name, dir) {
|
|
|
136
135
|
return node_path.join(remoteModuleDir, `${remoteModuleName}.js`);
|
|
137
136
|
}
|
|
138
137
|
function resolveModule(moduleName) {
|
|
139
|
-
return node_path.resolve(
|
|
138
|
+
return node_path.resolve(__rspack_import_meta_dirname__, `../modules/${moduleName}`);
|
|
140
139
|
}
|
|
141
140
|
function replaceModule(from, to) {
|
|
142
141
|
return (resolved)=>{
|
|
@@ -10,11 +10,15 @@ var __webpack_require__ = {};
|
|
|
10
10
|
};
|
|
11
11
|
})();
|
|
12
12
|
(()=>{
|
|
13
|
-
__webpack_require__.d = (exports1,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
14
|
+
var define = (defs, kind)=>{
|
|
15
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
[kind]: defs[key]
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
define(getters, "get");
|
|
21
|
+
define(values, "value");
|
|
18
22
|
};
|
|
19
23
|
})();
|
|
20
24
|
(()=>{
|
|
@@ -22,7 +26,7 @@ var __webpack_require__ = {};
|
|
|
22
26
|
})();
|
|
23
27
|
(()=>{
|
|
24
28
|
__webpack_require__.r = (exports1)=>{
|
|
25
|
-
if (
|
|
29
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
30
|
value: 'Module'
|
|
27
31
|
});
|
|
28
32
|
Object.defineProperty(exports1, '__esModule', {
|
|
@@ -60,10 +64,10 @@ function createRewriteRequest({ config, originalEntryFilename, remoteEntryFilena
|
|
|
60
64
|
const target = (0, external_helpers_js_namespaceObject.toPosixPath)(manifestPath.replace(root, '[metro-project]'));
|
|
61
65
|
return url.replace(external_constants_js_namespaceObject.MANIFEST_FILENAME, target);
|
|
62
66
|
}
|
|
63
|
-
const dtsAssets =
|
|
67
|
+
const dtsAssets = getDtsAssetNames?.();
|
|
64
68
|
const dtsAssetName = [
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
dtsAssets?.zipName,
|
|
70
|
+
dtsAssets?.apiFileName
|
|
67
71
|
].filter((value)=>Boolean(value)).find((value)=>pathname === `/${value}`);
|
|
68
72
|
if (dtsAssetName) {
|
|
69
73
|
const target = `${relativeTmpDirPath}/${dtsAssetName}`;
|
|
@@ -77,9 +81,9 @@ function getEntryPathRegex(entryFilename) {
|
|
|
77
81
|
return new RegExp(`^\\/${entryFilename}(\\.js)?(\\.bundle)$`);
|
|
78
82
|
}
|
|
79
83
|
exports.createRewriteRequest = __webpack_exports__.createRewriteRequest;
|
|
80
|
-
for(var
|
|
84
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
81
85
|
"createRewriteRequest"
|
|
82
|
-
].indexOf(
|
|
86
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
83
87
|
Object.defineProperty(exports, '__esModule', {
|
|
84
88
|
value: true
|
|
85
89
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
/*#__PURE__*/ import.meta.url;
|
|
1
|
+
import "node:module";
|
|
3
2
|
import node_path from "node:path";
|
|
4
3
|
import { MANIFEST_FILENAME } from "./constants.mjs";
|
|
5
4
|
import { removeExtension, toPosixPath } from "./helpers.mjs";
|
|
@@ -24,10 +23,10 @@ function createRewriteRequest({ config, originalEntryFilename, remoteEntryFilena
|
|
|
24
23
|
const target = toPosixPath(manifestPath.replace(root, '[metro-project]'));
|
|
25
24
|
return url.replace(MANIFEST_FILENAME, target);
|
|
26
25
|
}
|
|
27
|
-
const dtsAssets =
|
|
26
|
+
const dtsAssets = getDtsAssetNames?.();
|
|
28
27
|
const dtsAssetName = [
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
dtsAssets?.zipName,
|
|
29
|
+
dtsAssets?.apiFileName
|
|
31
30
|
].filter((value)=>Boolean(value)).find((value)=>pathname === `/${value}`);
|
|
32
31
|
if (dtsAssetName) {
|
|
33
32
|
const target = `${relativeTmpDirPath}/${dtsAssetName}`;
|
|
@@ -10,11 +10,15 @@ var __webpack_require__ = {};
|
|
|
10
10
|
};
|
|
11
11
|
})();
|
|
12
12
|
(()=>{
|
|
13
|
-
__webpack_require__.d = (exports1,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
14
|
+
var define = (defs, kind)=>{
|
|
15
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
[kind]: defs[key]
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
define(getters, "get");
|
|
21
|
+
define(values, "value");
|
|
18
22
|
};
|
|
19
23
|
})();
|
|
20
24
|
(()=>{
|
|
@@ -22,7 +26,7 @@ var __webpack_require__ = {};
|
|
|
22
26
|
})();
|
|
23
27
|
(()=>{
|
|
24
28
|
__webpack_require__.r = (exports1)=>{
|
|
25
|
-
if (
|
|
29
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
30
|
value: 'Module'
|
|
27
31
|
});
|
|
28
32
|
Object.defineProperty(exports1, '__esModule', {
|
|
@@ -161,7 +165,7 @@ function getBundlePath(entryPoint, projectRoot, exposes, isUsingMFBundleCommand)
|
|
|
161
165
|
}));
|
|
162
166
|
const exactMatch = exposeEntries.find(({ normalizedExposePath })=>normalizedExposePath === normalizedRelativeEntryPath);
|
|
163
167
|
const extensionlessMatch = exposeEntries.find(({ normalizedExposePath })=>removePathExtension(normalizedExposePath) === removePathExtension(normalizedRelativeEntryPath));
|
|
164
|
-
const exposedMatchedKey =
|
|
168
|
+
const exposedMatchedKey = exactMatch?.exposeKey ?? extensionlessMatch?.exposeKey;
|
|
165
169
|
if (exposedMatchedKey) {
|
|
166
170
|
let exposedName = exposedMatchedKey;
|
|
167
171
|
if (exposedName.startsWith('./')) exposedName = exposedName.slice(2);
|
|
@@ -186,9 +190,9 @@ function getBundleCode(entryPoint, preModules, graph, options) {
|
|
|
186
190
|
return code;
|
|
187
191
|
}
|
|
188
192
|
exports.getModuleFederationSerializer = __webpack_exports__.getModuleFederationSerializer;
|
|
189
|
-
for(var
|
|
193
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
190
194
|
"getModuleFederationSerializer"
|
|
191
|
-
].indexOf(
|
|
195
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
192
196
|
Object.defineProperty(exports, '__esModule', {
|
|
193
197
|
value: true
|
|
194
198
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
/*#__PURE__*/ import.meta.url;
|
|
1
|
+
import "node:module";
|
|
3
2
|
import node_path from "node:path";
|
|
4
3
|
import { ConfigError } from "../utils/errors.mjs";
|
|
5
4
|
import { toPosixPath } from "./helpers.mjs";
|
|
@@ -125,7 +124,7 @@ function getBundlePath(entryPoint, projectRoot, exposes, isUsingMFBundleCommand)
|
|
|
125
124
|
}));
|
|
126
125
|
const exactMatch = exposeEntries.find(({ normalizedExposePath })=>normalizedExposePath === normalizedRelativeEntryPath);
|
|
127
126
|
const extensionlessMatch = exposeEntries.find(({ normalizedExposePath })=>removePathExtension(normalizedExposePath) === removePathExtension(normalizedRelativeEntryPath));
|
|
128
|
-
const exposedMatchedKey =
|
|
127
|
+
const exposedMatchedKey = exactMatch?.exposeKey ?? extensionlessMatch?.exposeKey;
|
|
129
128
|
if (exposedMatchedKey) {
|
|
130
129
|
let exposedName = exposedMatchedKey;
|
|
131
130
|
if (exposedName.startsWith('./')) exposedName = exposedName.slice(2);
|