@module-federation/modern-js 0.0.0-next-20240520131203 → 0.0.0-next-20240520135817
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/cjs/cli/utils.js
CHANGED
|
@@ -34,6 +34,7 @@ __export(utils_exports, {
|
|
|
34
34
|
patchWebpackConfig: () => patchWebpackConfig
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(utils_exports);
|
|
37
|
+
var import_sdk = require("@module-federation/sdk");
|
|
37
38
|
var import_path = __toESM(require("path"));
|
|
38
39
|
var import_node_bundle_require = require("@modern-js/node-bundle-require");
|
|
39
40
|
const defaultPath = import_path.default.resolve(process.cwd(), "module-federation.config.ts");
|
|
@@ -119,7 +120,7 @@ function patchWebpackConfig(options) {
|
|
|
119
120
|
const uniqueName = mfConfig.name || (output === null || output === void 0 ? void 0 : output.uniqueName);
|
|
120
121
|
const chunkFileName = output === null || output === void 0 ? void 0 : output.chunkFilename;
|
|
121
122
|
if (output && typeof chunkFileName === "string" && uniqueName && !chunkFileName.includes(uniqueName)) {
|
|
122
|
-
const suffix =
|
|
123
|
+
const suffix = `${(0, import_sdk.encodeName)(uniqueName)}-[chunkhash].js`;
|
|
123
124
|
output.chunkFilename = chunkFileName.replace(".js", suffix);
|
|
124
125
|
}
|
|
125
126
|
}
|
package/dist/esm/cli/utils.js
CHANGED
|
@@ -3,6 +3,7 @@ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
|
3
3
|
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
4
4
|
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
|
|
5
5
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
6
|
+
import { encodeName } from "@module-federation/sdk";
|
|
6
7
|
import path from "path";
|
|
7
8
|
import { bundle } from "@modern-js/node-bundle-require";
|
|
8
9
|
var defaultPath = path.resolve(process.cwd(), "module-federation.config.ts");
|
|
@@ -109,7 +110,7 @@ function patchWebpackConfig(options) {
|
|
|
109
110
|
var uniqueName = mfConfig.name || (output === null || output === void 0 ? void 0 : output.uniqueName);
|
|
110
111
|
var chunkFileName = output === null || output === void 0 ? void 0 : output.chunkFilename;
|
|
111
112
|
if (output && typeof chunkFileName === "string" && uniqueName && !chunkFileName.includes(uniqueName)) {
|
|
112
|
-
var suffix = "-[chunkhash].js";
|
|
113
|
+
var suffix = "".concat(encodeName(uniqueName), "-[chunkhash].js");
|
|
113
114
|
output.chunkFilename = chunkFileName.replace(".js", suffix);
|
|
114
115
|
}
|
|
115
116
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { encodeName } from "@module-federation/sdk";
|
|
1
2
|
import path from "path";
|
|
2
3
|
import { bundle } from "@modern-js/node-bundle-require";
|
|
3
4
|
const defaultPath = path.resolve(process.cwd(), "module-federation.config.ts");
|
|
@@ -83,7 +84,7 @@ function patchWebpackConfig(options) {
|
|
|
83
84
|
const uniqueName = mfConfig.name || (output === null || output === void 0 ? void 0 : output.uniqueName);
|
|
84
85
|
const chunkFileName = output === null || output === void 0 ? void 0 : output.chunkFilename;
|
|
85
86
|
if (output && typeof chunkFileName === "string" && uniqueName && !chunkFileName.includes(uniqueName)) {
|
|
86
|
-
const suffix =
|
|
87
|
+
const suffix = `${encodeName(uniqueName)}-[chunkhash].js`;
|
|
87
88
|
output.chunkFilename = chunkFileName.replace(".js", suffix);
|
|
88
89
|
}
|
|
89
90
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/modern-js",
|
|
3
|
-
"version": "0.0.0-next-
|
|
3
|
+
"version": "0.0.0-next-20240520135817",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist/",
|
|
6
6
|
"types.d.ts",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"@modern-js/utils": "^2.49.2",
|
|
47
47
|
"@modern-js/node-bundle-require": "^2.49.2",
|
|
48
48
|
"node-fetch": "~3.3.0",
|
|
49
|
-
"@module-federation/sdk": "0.0.0-next-
|
|
50
|
-
"@module-federation/enhanced": "0.0.0-next-
|
|
51
|
-
"@module-federation/node": "0.0.0-next-
|
|
49
|
+
"@module-federation/sdk": "0.0.0-next-20240520135817",
|
|
50
|
+
"@module-federation/enhanced": "0.0.0-next-20240520135817",
|
|
51
|
+
"@module-federation/node": "0.0.0-next-20240520135817"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@modern-js/app-tools": "^2.49.2",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@modern-js/runtime": "^2.49.2",
|
|
57
57
|
"@modern-js/module-tools": "^2.35.0",
|
|
58
58
|
"@modern-js/tsconfig": "^2.35.0",
|
|
59
|
-
"@module-federation/manifest": "0.0.0-next-
|
|
59
|
+
"@module-federation/manifest": "0.0.0-next-20240520135817"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"build": "modern build"
|