@module-federation/rsbuild-plugin 2.6.0 → 2.8.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/cli/index.js +33 -39
- package/dist/cli/index.mjs +18 -34
- package/dist/constant.js +24 -20
- package/dist/constant.mjs +0 -2
- package/dist/index.js +19 -18
- package/dist/index.mjs +1 -2
- package/dist/logger.js +14 -12
- package/dist/logger.mjs +2 -4
- package/dist/utils/addDataFetchExposes.js +13 -11
- package/dist/utils/addDataFetchExposes.mjs +0 -5
- package/dist/utils/autoDeleteSplitChunkCacheGroups.js +18 -15
- package/dist/utils/autoDeleteSplitChunkCacheGroups.mjs +1 -3
- package/dist/utils/index.js +19 -17
- package/dist/utils/index.mjs +6 -13
- package/dist/utils/manifest.js +13 -11
- package/dist/utils/manifest.mjs +0 -3
- package/dist/utils/ssr.d.ts +3 -1
- package/dist/utils/ssr.js +52 -45
- package/dist/utils/ssr.mjs +32 -32
- package/dist/utils.js +19 -18
- package/dist/utils.mjs +1 -2
- package/package.json +9 -8
|
@@ -9,7 +9,6 @@ const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
|
|
|
9
9
|
// The require scope
|
|
10
10
|
var __webpack_require__ = {};
|
|
11
11
|
|
|
12
|
-
/************************************************************************/
|
|
13
12
|
// webpack/runtime/compat_get_default_export
|
|
14
13
|
(() => {
|
|
15
14
|
// getDefaultExport function for compatibility with non-ESM modules
|
|
@@ -24,12 +23,16 @@ __webpack_require__.n = (module) => {
|
|
|
24
23
|
})();
|
|
25
24
|
// webpack/runtime/define_property_getters
|
|
26
25
|
(() => {
|
|
27
|
-
__webpack_require__.d = (exports,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
__webpack_require__.d = (exports, getters, values) => {
|
|
27
|
+
var define = (defs, kind) => {
|
|
28
|
+
for(var key in defs) {
|
|
29
|
+
if(__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key)) {
|
|
30
|
+
Object.defineProperty(exports, key, { enumerable: true, [kind]: defs[key] });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
define(getters, "get");
|
|
35
|
+
define(values, "value");
|
|
33
36
|
};
|
|
34
37
|
})();
|
|
35
38
|
// webpack/runtime/has_own_property
|
|
@@ -46,7 +49,6 @@ __webpack_require__.r = (exports) => {
|
|
|
46
49
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
47
50
|
};
|
|
48
51
|
})();
|
|
49
|
-
/************************************************************************/
|
|
50
52
|
var __webpack_exports__ = {};
|
|
51
53
|
// ESM COMPAT FLAG
|
|
52
54
|
__webpack_require__.r(__webpack_exports__);
|
|
@@ -120,9 +122,9 @@ function addDataFetchExposes(exposes, isServer) {
|
|
|
120
122
|
}
|
|
121
123
|
|
|
122
124
|
exports.addDataFetchExposes = __webpack_exports__.addDataFetchExposes;
|
|
123
|
-
for(var
|
|
124
|
-
if(["addDataFetchExposes"].indexOf(
|
|
125
|
-
exports[
|
|
125
|
+
for(var __rspack_i in __webpack_exports__) {
|
|
126
|
+
if(["addDataFetchExposes"].indexOf(__rspack_i) === -1) {
|
|
127
|
+
exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
126
128
|
}
|
|
127
129
|
}
|
|
128
130
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -3,15 +3,10 @@ import path from "path";
|
|
|
3
3
|
import { TEMP_DIR } from "@module-federation/sdk";
|
|
4
4
|
import { DATA_FETCH_CLIENT_SUFFIX, DATA_FETCH_IDENTIFIER } from "../constant.mjs";
|
|
5
5
|
|
|
6
|
-
;// CONCATENATED MODULE: external "fs"
|
|
7
6
|
|
|
8
|
-
;// CONCATENATED MODULE: external "path"
|
|
9
7
|
|
|
10
|
-
;// CONCATENATED MODULE: external "@module-federation/sdk"
|
|
11
8
|
|
|
12
|
-
;// CONCATENATED MODULE: external "../constant.mjs"
|
|
13
9
|
|
|
14
|
-
;// CONCATENATED MODULE: ./src/utils/addDataFetchExposes.ts
|
|
15
10
|
|
|
16
11
|
|
|
17
12
|
|
|
@@ -9,15 +9,18 @@ const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
|
|
|
9
9
|
// The require scope
|
|
10
10
|
var __webpack_require__ = {};
|
|
11
11
|
|
|
12
|
-
/************************************************************************/
|
|
13
12
|
// webpack/runtime/define_property_getters
|
|
14
13
|
(() => {
|
|
15
|
-
__webpack_require__.d = (exports,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
__webpack_require__.d = (exports, getters, values) => {
|
|
15
|
+
var define = (defs, kind) => {
|
|
16
|
+
for(var key in defs) {
|
|
17
|
+
if(__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key)) {
|
|
18
|
+
Object.defineProperty(exports, key, { enumerable: true, [kind]: defs[key] });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
define(getters, "get");
|
|
23
|
+
define(values, "value");
|
|
21
24
|
};
|
|
22
25
|
})();
|
|
23
26
|
// webpack/runtime/has_own_property
|
|
@@ -34,12 +37,8 @@ __webpack_require__.r = (exports) => {
|
|
|
34
37
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
35
38
|
};
|
|
36
39
|
})();
|
|
37
|
-
/************************************************************************/
|
|
38
40
|
var __webpack_exports__ = {};
|
|
39
41
|
__webpack_require__.r(__webpack_exports__);
|
|
40
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
41
|
-
autoDeleteSplitChunkCacheGroups: () => (autoDeleteSplitChunkCacheGroups)
|
|
42
|
-
});
|
|
43
42
|
// lib-polyfill.js: include core-js,@babel/runtime,@swc/helpers,tslib.
|
|
44
43
|
// lib-react.js: include react,react-dom.
|
|
45
44
|
// lib-router.js: include react-router,react-router-dom,history,@remix-run/router.
|
|
@@ -74,7 +73,7 @@ function autoDeleteSplitChunkCacheGroups(mfConfig, splitChunks) {
|
|
|
74
73
|
if (!mfConfig.shared) {
|
|
75
74
|
return;
|
|
76
75
|
}
|
|
77
|
-
if (!splitChunks || !
|
|
76
|
+
if (!splitChunks || !splitChunks?.cacheGroups) {
|
|
78
77
|
return;
|
|
79
78
|
}
|
|
80
79
|
const arrayShared = Array.isArray(mfConfig.shared) ? mfConfig.shared : Object.keys(mfConfig.shared);
|
|
@@ -90,10 +89,14 @@ function autoDeleteSplitChunkCacheGroups(mfConfig, splitChunks) {
|
|
|
90
89
|
return splitChunks;
|
|
91
90
|
}
|
|
92
91
|
|
|
92
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
93
|
+
autoDeleteSplitChunkCacheGroups: () => (autoDeleteSplitChunkCacheGroups)
|
|
94
|
+
});
|
|
95
|
+
|
|
93
96
|
exports.autoDeleteSplitChunkCacheGroups = __webpack_exports__.autoDeleteSplitChunkCacheGroups;
|
|
94
|
-
for(var
|
|
95
|
-
if(["autoDeleteSplitChunkCacheGroups"].indexOf(
|
|
96
|
-
exports[
|
|
97
|
+
for(var __rspack_i in __webpack_exports__) {
|
|
98
|
+
if(["autoDeleteSplitChunkCacheGroups"].indexOf(__rspack_i) === -1) {
|
|
99
|
+
exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
97
100
|
}
|
|
98
101
|
}
|
|
99
102
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
;// CONCATENATED MODULE: ./src/utils/autoDeleteSplitChunkCacheGroups.ts
|
|
3
1
|
// lib-polyfill.js: include core-js,@babel/runtime,@swc/helpers,tslib.
|
|
4
2
|
// lib-react.js: include react,react-dom.
|
|
5
3
|
// lib-router.js: include react-router,react-router-dom,history,@remix-run/router.
|
|
@@ -34,7 +32,7 @@ function autoDeleteSplitChunkCacheGroups(mfConfig, splitChunks) {
|
|
|
34
32
|
if (!mfConfig.shared) {
|
|
35
33
|
return;
|
|
36
34
|
}
|
|
37
|
-
if (!splitChunks || !
|
|
35
|
+
if (!splitChunks || !splitChunks?.cacheGroups) {
|
|
38
36
|
return;
|
|
39
37
|
}
|
|
40
38
|
const arrayShared = Array.isArray(mfConfig.shared) ? mfConfig.shared : Object.keys(mfConfig.shared);
|
package/dist/utils/index.js
CHANGED
|
@@ -9,7 +9,6 @@ const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
|
|
|
9
9
|
// The require scope
|
|
10
10
|
var __webpack_require__ = {};
|
|
11
11
|
|
|
12
|
-
/************************************************************************/
|
|
13
12
|
// webpack/runtime/compat_get_default_export
|
|
14
13
|
(() => {
|
|
15
14
|
// getDefaultExport function for compatibility with non-ESM modules
|
|
@@ -24,12 +23,16 @@ __webpack_require__.n = (module) => {
|
|
|
24
23
|
})();
|
|
25
24
|
// webpack/runtime/define_property_getters
|
|
26
25
|
(() => {
|
|
27
|
-
__webpack_require__.d = (exports,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
__webpack_require__.d = (exports, getters, values) => {
|
|
27
|
+
var define = (defs, kind) => {
|
|
28
|
+
for(var key in defs) {
|
|
29
|
+
if(__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key)) {
|
|
30
|
+
Object.defineProperty(exports, key, { enumerable: true, [kind]: defs[key] });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
define(getters, "get");
|
|
35
|
+
define(values, "value");
|
|
33
36
|
};
|
|
34
37
|
})();
|
|
35
38
|
// webpack/runtime/has_own_property
|
|
@@ -46,24 +49,23 @@ __webpack_require__.r = (exports) => {
|
|
|
46
49
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
47
50
|
};
|
|
48
51
|
})();
|
|
49
|
-
/************************************************************************/
|
|
50
52
|
var __webpack_exports__ = {};
|
|
51
53
|
// ESM COMPAT FLAG
|
|
52
54
|
__webpack_require__.r(__webpack_exports__);
|
|
53
55
|
|
|
54
56
|
// EXPORTS
|
|
55
57
|
__webpack_require__.d(__webpack_exports__, {
|
|
56
|
-
createSSRREnvConfig: () => (/* reexport */ external_ssr_js_namespaceObject.createSSRREnvConfig),
|
|
57
58
|
DEFAULT_ASSET_PREFIX: () => (/* reexport */ external_constant_js_namespaceObject.DEFAULT_ASSET_PREFIX),
|
|
59
|
+
SSR_DIR: () => (/* reexport */ external_ssr_js_namespaceObject.SSR_DIR),
|
|
58
60
|
SSR_ENV_NAME: () => (/* reexport */ external_ssr_js_namespaceObject.SSR_ENV_NAME),
|
|
61
|
+
addDataFetchExposes: () => (/* reexport */ external_addDataFetchExposes_js_namespaceObject.addDataFetchExposes),
|
|
59
62
|
autoDeleteSplitChunkCacheGroups: () => (/* reexport */ external_autoDeleteSplitChunkCacheGroups_js_namespaceObject.autoDeleteSplitChunkCacheGroups),
|
|
60
|
-
|
|
61
|
-
|
|
63
|
+
createSSRMFConfig: () => (/* reexport */ external_ssr_js_namespaceObject.createSSRMFConfig),
|
|
64
|
+
createSSRREnvConfig: () => (/* reexport */ external_ssr_js_namespaceObject.createSSRREnvConfig),
|
|
62
65
|
isRegExp: () => (/* binding */ isRegExp),
|
|
63
66
|
patchSSRRspackConfig: () => (/* reexport */ external_ssr_js_namespaceObject.patchSSRRspackConfig),
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
addDataFetchExposes: () => (/* reexport */ external_addDataFetchExposes_js_namespaceObject.addDataFetchExposes)
|
|
67
|
+
setSSREnv: () => (/* reexport */ external_ssr_js_namespaceObject.setSSREnv),
|
|
68
|
+
updateStatsAndManifest: () => (/* reexport */ external_manifest_js_namespaceObject.updateStatsAndManifest)
|
|
67
69
|
});
|
|
68
70
|
|
|
69
71
|
;// CONCATENATED MODULE: external "util"
|
|
@@ -101,9 +103,9 @@ exports.isRegExp = __webpack_exports__.isRegExp;
|
|
|
101
103
|
exports.patchSSRRspackConfig = __webpack_exports__.patchSSRRspackConfig;
|
|
102
104
|
exports.setSSREnv = __webpack_exports__.setSSREnv;
|
|
103
105
|
exports.updateStatsAndManifest = __webpack_exports__.updateStatsAndManifest;
|
|
104
|
-
for(var
|
|
105
|
-
if(["DEFAULT_ASSET_PREFIX","SSR_DIR","SSR_ENV_NAME","addDataFetchExposes","autoDeleteSplitChunkCacheGroups","createSSRMFConfig","createSSRREnvConfig","isRegExp","patchSSRRspackConfig","setSSREnv","updateStatsAndManifest"].indexOf(
|
|
106
|
-
exports[
|
|
106
|
+
for(var __rspack_i in __webpack_exports__) {
|
|
107
|
+
if(["DEFAULT_ASSET_PREFIX","SSR_DIR","SSR_ENV_NAME","addDataFetchExposes","autoDeleteSplitChunkCacheGroups","createSSRMFConfig","createSSRREnvConfig","isRegExp","patchSSRRspackConfig","setSSREnv","updateStatsAndManifest"].indexOf(__rspack_i) === -1) {
|
|
108
|
+
exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
107
109
|
}
|
|
108
110
|
}
|
|
109
111
|
Object.defineProperty(exports, '__esModule', { value: true });
|
package/dist/utils/index.mjs
CHANGED
|
@@ -1,23 +1,11 @@
|
|
|
1
1
|
import util from "util";
|
|
2
|
-
import { DEFAULT_ASSET_PREFIX } from "../constant.mjs";
|
|
3
|
-
import { autoDeleteSplitChunkCacheGroups } from "./autoDeleteSplitChunkCacheGroups.mjs";
|
|
4
|
-
import { addDataFetchExposes } from "./addDataFetchExposes.mjs";
|
|
5
|
-
import { updateStatsAndManifest } from "./manifest.mjs";
|
|
6
|
-
import { SSR_DIR, SSR_ENV_NAME, createSSRMFConfig, createSSRREnvConfig, patchSSRRspackConfig, setSSREnv } from "./ssr.mjs";
|
|
7
2
|
|
|
8
|
-
;// CONCATENATED MODULE: external "util"
|
|
9
3
|
|
|
10
|
-
;// CONCATENATED MODULE: external "../constant.mjs"
|
|
11
4
|
|
|
12
|
-
;// CONCATENATED MODULE: external "./autoDeleteSplitChunkCacheGroups.mjs"
|
|
13
5
|
|
|
14
|
-
;// CONCATENATED MODULE: external "./addDataFetchExposes.mjs"
|
|
15
6
|
|
|
16
|
-
;// CONCATENATED MODULE: external "./manifest.mjs"
|
|
17
7
|
|
|
18
|
-
;// CONCATENATED MODULE: external "./ssr.mjs"
|
|
19
8
|
|
|
20
|
-
;// CONCATENATED MODULE: ./src/utils/index.ts
|
|
21
9
|
|
|
22
10
|
function isRegExp(target) {
|
|
23
11
|
return util.types.isRegExp(target);
|
|
@@ -28,4 +16,9 @@ function isRegExp(target) {
|
|
|
28
16
|
|
|
29
17
|
|
|
30
18
|
|
|
31
|
-
export {
|
|
19
|
+
export { isRegExp };
|
|
20
|
+
export { DEFAULT_ASSET_PREFIX } from "../constant.mjs";
|
|
21
|
+
export { autoDeleteSplitChunkCacheGroups } from "./autoDeleteSplitChunkCacheGroups.mjs";
|
|
22
|
+
export { addDataFetchExposes } from "./addDataFetchExposes.mjs";
|
|
23
|
+
export { updateStatsAndManifest } from "./manifest.mjs";
|
|
24
|
+
export { SSR_DIR, SSR_ENV_NAME, createSSRMFConfig, createSSRREnvConfig, patchSSRRspackConfig, setSSREnv } from "./ssr.mjs";
|
package/dist/utils/manifest.js
CHANGED
|
@@ -9,7 +9,6 @@ const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
|
|
|
9
9
|
// The require scope
|
|
10
10
|
var __webpack_require__ = {};
|
|
11
11
|
|
|
12
|
-
/************************************************************************/
|
|
13
12
|
// webpack/runtime/compat_get_default_export
|
|
14
13
|
(() => {
|
|
15
14
|
// getDefaultExport function for compatibility with non-ESM modules
|
|
@@ -24,12 +23,16 @@ __webpack_require__.n = (module) => {
|
|
|
24
23
|
})();
|
|
25
24
|
// webpack/runtime/define_property_getters
|
|
26
25
|
(() => {
|
|
27
|
-
__webpack_require__.d = (exports,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
__webpack_require__.d = (exports, getters, values) => {
|
|
27
|
+
var define = (defs, kind) => {
|
|
28
|
+
for(var key in defs) {
|
|
29
|
+
if(__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key)) {
|
|
30
|
+
Object.defineProperty(exports, key, { enumerable: true, [kind]: defs[key] });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
define(getters, "get");
|
|
35
|
+
define(values, "value");
|
|
33
36
|
};
|
|
34
37
|
})();
|
|
35
38
|
// webpack/runtime/has_own_property
|
|
@@ -46,7 +49,6 @@ __webpack_require__.r = (exports) => {
|
|
|
46
49
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
47
50
|
};
|
|
48
51
|
})();
|
|
49
|
-
/************************************************************************/
|
|
50
52
|
var __webpack_exports__ = {};
|
|
51
53
|
// ESM COMPAT FLAG
|
|
52
54
|
__webpack_require__.r(__webpack_exports__);
|
|
@@ -105,9 +107,9 @@ function updateStatsAndManifest(nodeAssets, browserAssets, outputDir) {
|
|
|
105
107
|
}
|
|
106
108
|
|
|
107
109
|
exports.updateStatsAndManifest = __webpack_exports__.updateStatsAndManifest;
|
|
108
|
-
for(var
|
|
109
|
-
if(["updateStatsAndManifest"].indexOf(
|
|
110
|
-
exports[
|
|
110
|
+
for(var __rspack_i in __webpack_exports__) {
|
|
111
|
+
if(["updateStatsAndManifest"].indexOf(__rspack_i) === -1) {
|
|
112
|
+
exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
111
113
|
}
|
|
112
114
|
}
|
|
113
115
|
Object.defineProperty(exports, '__esModule', { value: true });
|
package/dist/utils/manifest.mjs
CHANGED
package/dist/utils/ssr.d.ts
CHANGED
|
@@ -35,7 +35,9 @@ export declare function createSSRMFConfig(mfConfig: moduleFederationPlugin.Modul
|
|
|
35
35
|
asyncStartup?: boolean;
|
|
36
36
|
optimization?: {
|
|
37
37
|
disableSnapshot?: boolean;
|
|
38
|
-
|
|
38
|
+
disableRemote?: boolean;
|
|
39
|
+
disableShared?: boolean;
|
|
40
|
+
target?: 'web' | 'node';
|
|
39
41
|
};
|
|
40
42
|
};
|
|
41
43
|
bridge?: {
|
package/dist/utils/ssr.js
CHANGED
|
@@ -9,7 +9,6 @@ const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
|
|
|
9
9
|
// The require scope
|
|
10
10
|
var __webpack_require__ = {};
|
|
11
11
|
|
|
12
|
-
/************************************************************************/
|
|
13
12
|
// webpack/runtime/compat_get_default_export
|
|
14
13
|
(() => {
|
|
15
14
|
// getDefaultExport function for compatibility with non-ESM modules
|
|
@@ -24,12 +23,16 @@ __webpack_require__.n = (module) => {
|
|
|
24
23
|
})();
|
|
25
24
|
// webpack/runtime/define_property_getters
|
|
26
25
|
(() => {
|
|
27
|
-
__webpack_require__.d = (exports,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
__webpack_require__.d = (exports, getters, values) => {
|
|
27
|
+
var define = (defs, kind) => {
|
|
28
|
+
for(var key in defs) {
|
|
29
|
+
if(__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key)) {
|
|
30
|
+
Object.defineProperty(exports, key, { enumerable: true, [kind]: defs[key] });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
define(getters, "get");
|
|
35
|
+
define(values, "value");
|
|
33
36
|
};
|
|
34
37
|
})();
|
|
35
38
|
// webpack/runtime/has_own_property
|
|
@@ -46,23 +49,22 @@ __webpack_require__.r = (exports) => {
|
|
|
46
49
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
47
50
|
};
|
|
48
51
|
})();
|
|
49
|
-
/************************************************************************/
|
|
50
52
|
var __webpack_exports__ = {};
|
|
51
53
|
// ESM COMPAT FLAG
|
|
52
54
|
__webpack_require__.r(__webpack_exports__);
|
|
53
55
|
|
|
54
56
|
// EXPORTS
|
|
55
57
|
__webpack_require__.d(__webpack_exports__, {
|
|
56
|
-
|
|
58
|
+
ENV_NAME: () => (/* binding */ ENV_NAME),
|
|
59
|
+
SSR_DIR: () => (/* binding */ SSR_DIR),
|
|
60
|
+
SSR_ENV_NAME: () => (/* binding */ SSR_ENV_NAME),
|
|
61
|
+
createSSRMFConfig: () => (/* binding */ createSSRMFConfig),
|
|
57
62
|
createSSRREnvConfig: () => (/* binding */ createSSRREnvConfig),
|
|
58
|
-
|
|
63
|
+
patchNodeConfig: () => (/* binding */ patchNodeConfig),
|
|
59
64
|
patchNodeMFConfig: () => (/* binding */ patchNodeMFConfig),
|
|
60
|
-
SSR_ENV_NAME: () => (/* binding */ SSR_ENV_NAME),
|
|
61
|
-
patchToolsTspack: () => (/* binding */ patchToolsTspack),
|
|
62
65
|
patchSSRRspackConfig: () => (/* binding */ patchSSRRspackConfig),
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
createSSRMFConfig: () => (/* binding */ createSSRMFConfig)
|
|
66
|
+
patchToolsTspack: () => (/* binding */ patchToolsTspack),
|
|
67
|
+
setSSREnv: () => (/* binding */ setSSREnv)
|
|
66
68
|
});
|
|
67
69
|
|
|
68
70
|
;// CONCATENATED MODULE: external "path"
|
|
@@ -105,7 +107,6 @@ const isDev = ()=>{
|
|
|
105
107
|
return process.env['NODE_ENV'] === 'development';
|
|
106
108
|
};
|
|
107
109
|
function patchNodeConfig(config, mfConfig) {
|
|
108
|
-
var _config_output;
|
|
109
110
|
config.output ||= {};
|
|
110
111
|
if (config.output.publicPath === 'auto') {
|
|
111
112
|
config.output.publicPath = '';
|
|
@@ -116,14 +117,30 @@ function patchNodeConfig(config, mfConfig) {
|
|
|
116
117
|
config.output.module = false;
|
|
117
118
|
config.output.chunkFormat = 'commonjs';
|
|
118
119
|
config.output.chunkLoading = 'async-node';
|
|
120
|
+
const prevLibrary = config.output.library;
|
|
121
|
+
if (prevLibrary && typeof prevLibrary === 'object' && !Array.isArray(prevLibrary)) {
|
|
122
|
+
config.output.library = {
|
|
123
|
+
...prevLibrary,
|
|
124
|
+
type: 'commonjs-module'
|
|
125
|
+
};
|
|
126
|
+
} else if (typeof prevLibrary === 'string' || Array.isArray(prevLibrary)) {
|
|
127
|
+
config.output.library = {
|
|
128
|
+
name: prevLibrary,
|
|
129
|
+
type: 'commonjs-module'
|
|
130
|
+
};
|
|
131
|
+
} else {
|
|
132
|
+
config.output.library = {
|
|
133
|
+
type: 'commonjs-module'
|
|
134
|
+
};
|
|
135
|
+
}
|
|
119
136
|
delete config.output.chunkLoadingGlobal;
|
|
120
137
|
const UniverseEntryChunkTrackerPluginModule = safeRequire('@module-federation/node/universe-entry-chunk-tracker-plugin');
|
|
121
|
-
const UniverseEntryChunkTrackerPlugin = UniverseEntryChunkTrackerPluginModule
|
|
138
|
+
const UniverseEntryChunkTrackerPlugin = UniverseEntryChunkTrackerPluginModule?.default;
|
|
122
139
|
config.plugins ||= [];
|
|
123
140
|
if (isDev() && UniverseEntryChunkTrackerPlugin) {
|
|
124
141
|
config.plugins.push(new UniverseEntryChunkTrackerPlugin());
|
|
125
142
|
}
|
|
126
|
-
const uniqueName = mfConfig.name ||
|
|
143
|
+
const uniqueName = mfConfig.name || config.output?.uniqueName;
|
|
127
144
|
const chunkFileName = config.output.chunkFilename;
|
|
128
145
|
if (typeof chunkFileName === 'string' && uniqueName && !chunkFileName.includes(uniqueName)) {
|
|
129
146
|
const encodedName = (0,sdk_namespaceObject.encodeName)(uniqueName);
|
|
@@ -133,8 +150,7 @@ function patchNodeConfig(config, mfConfig) {
|
|
|
133
150
|
function patchSSRRspackConfig(config, mfConfig, ssrDir, callerName, resetEntry = true, modifyPublicPath = true) {
|
|
134
151
|
config.output ||= {};
|
|
135
152
|
if (modifyPublicPath) {
|
|
136
|
-
|
|
137
|
-
if (typeof ((_config_output = config.output) === null || _config_output === void 0 ? void 0 : _config_output.publicPath) !== 'string') {
|
|
153
|
+
if (typeof config.output?.publicPath !== 'string') {
|
|
138
154
|
throw new Error('publicPath must be string!');
|
|
139
155
|
}
|
|
140
156
|
const publicPath = config.output.publicPath;
|
|
@@ -151,16 +167,12 @@ function patchSSRRspackConfig(config, mfConfig, ssrDir, callerName, resetEntry =
|
|
|
151
167
|
return config;
|
|
152
168
|
}
|
|
153
169
|
function patchToolsTspack(envConfig, fn) {
|
|
154
|
-
var _envConfig_tools;
|
|
155
170
|
const rspackArr = [];
|
|
156
|
-
if (
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
rspackArr.push(
|
|
161
|
-
} else if (typeof ((_envConfig_tools2 = envConfig.tools) === null || _envConfig_tools2 === void 0 ? void 0 : _envConfig_tools2.rspack) === 'function') {
|
|
162
|
-
var _envConfig_tools4;
|
|
163
|
-
rspackArr.push((_envConfig_tools4 = envConfig.tools) === null || _envConfig_tools4 === void 0 ? void 0 : _envConfig_tools4.rspack);
|
|
171
|
+
if (envConfig.tools?.rspack) {
|
|
172
|
+
if (Array.isArray(envConfig.tools?.rspack)) {
|
|
173
|
+
rspackArr.push(...envConfig.tools?.rspack);
|
|
174
|
+
} else if (typeof envConfig.tools?.rspack === 'function') {
|
|
175
|
+
rspackArr.push(envConfig.tools?.rspack);
|
|
164
176
|
}
|
|
165
177
|
}
|
|
166
178
|
envConfig.tools ||= {};
|
|
@@ -170,16 +182,12 @@ function patchToolsTspack(envConfig, fn) {
|
|
|
170
182
|
];
|
|
171
183
|
}
|
|
172
184
|
function createSSRREnvConfig(envConfig, mfConfig, ssrDir, rsbuildConfig, callerName) {
|
|
173
|
-
var _envConfig_tools, _ssrEnvConfig_output, _ssrEnvConfig_output_distPath, _ssrEnvConfig_output1, _rsbuildConfig_output_distPath, _rsbuildConfig_output;
|
|
174
185
|
const rspackArr = [];
|
|
175
|
-
if (
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
rspackArr.push(
|
|
180
|
-
} else if (typeof ((_envConfig_tools2 = envConfig.tools) === null || _envConfig_tools2 === void 0 ? void 0 : _envConfig_tools2.rspack) === 'function') {
|
|
181
|
-
var _envConfig_tools4;
|
|
182
|
-
rspackArr.push((_envConfig_tools4 = envConfig.tools) === null || _envConfig_tools4 === void 0 ? void 0 : _envConfig_tools4.rspack);
|
|
186
|
+
if (envConfig.tools?.rspack) {
|
|
187
|
+
if (Array.isArray(envConfig.tools?.rspack)) {
|
|
188
|
+
rspackArr.push(...envConfig.tools?.rspack);
|
|
189
|
+
} else if (typeof envConfig.tools?.rspack === 'function') {
|
|
190
|
+
rspackArr.push(envConfig.tools?.rspack);
|
|
183
191
|
}
|
|
184
192
|
}
|
|
185
193
|
const ssrEnvConfig = {
|
|
@@ -197,15 +205,14 @@ function createSSRREnvConfig(envConfig, mfConfig, ssrDir, rsbuildConfig, callerN
|
|
|
197
205
|
// Rsbuild not support all rspack targets, so modify to async-node in modifyRspackConfig
|
|
198
206
|
target: 'node',
|
|
199
207
|
distPath: {
|
|
200
|
-
...
|
|
201
|
-
root: external_path_default().join(
|
|
208
|
+
...ssrEnvConfig.output?.distPath,
|
|
209
|
+
root: external_path_default().join(ssrEnvConfig.output?.distPath?.root || rsbuildConfig.output?.distPath?.root || '', ssrDir)
|
|
202
210
|
},
|
|
203
211
|
emitAssets: true
|
|
204
212
|
};
|
|
205
213
|
return ssrEnvConfig;
|
|
206
214
|
}
|
|
207
215
|
function patchNodeMFConfig(mfConfig) {
|
|
208
|
-
var _mfConfig_library;
|
|
209
216
|
if (mfConfig.remotes) {
|
|
210
217
|
mfConfig.remoteType = 'script';
|
|
211
218
|
}
|
|
@@ -215,7 +222,7 @@ function patchNodeMFConfig(mfConfig) {
|
|
|
215
222
|
mfConfig.library = {
|
|
216
223
|
...mfConfig.library,
|
|
217
224
|
name: mfConfig.name,
|
|
218
|
-
type:
|
|
225
|
+
type: mfConfig.library?.type ?? 'commonjs-module'
|
|
219
226
|
};
|
|
220
227
|
mfConfig.runtimePlugins = [
|
|
221
228
|
...mfConfig.runtimePlugins || []
|
|
@@ -245,9 +252,9 @@ exports.patchNodeMFConfig = __webpack_exports__.patchNodeMFConfig;
|
|
|
245
252
|
exports.patchSSRRspackConfig = __webpack_exports__.patchSSRRspackConfig;
|
|
246
253
|
exports.patchToolsTspack = __webpack_exports__.patchToolsTspack;
|
|
247
254
|
exports.setSSREnv = __webpack_exports__.setSSREnv;
|
|
248
|
-
for(var
|
|
249
|
-
if(["ENV_NAME","SSR_DIR","SSR_ENV_NAME","createSSRMFConfig","createSSRREnvConfig","patchNodeConfig","patchNodeMFConfig","patchSSRRspackConfig","patchToolsTspack","setSSREnv"].indexOf(
|
|
250
|
-
exports[
|
|
255
|
+
for(var __rspack_i in __webpack_exports__) {
|
|
256
|
+
if(["ENV_NAME","SSR_DIR","SSR_ENV_NAME","createSSRMFConfig","createSSRREnvConfig","patchNodeConfig","patchNodeMFConfig","patchSSRRspackConfig","patchToolsTspack","setSSREnv"].indexOf(__rspack_i) === -1) {
|
|
257
|
+
exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
251
258
|
}
|
|
252
259
|
}
|
|
253
260
|
Object.defineProperty(exports, '__esModule', { value: true });
|