@module-federation/modern-js 0.0.0-next-20241030095049 → 0.0.0-next-20241101093646
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/ssrPlugin.js +3 -2
- package/dist/cjs/cli/utils.js +1 -2
- package/dist/esm/cli/ssrPlugin.js +3 -2
- package/dist/esm/cli/utils.js +1 -2
- package/dist/esm-node/cli/ssrPlugin.js +3 -2
- package/dist/esm-node/cli/utils.js +1 -2
- package/package.json +5 -5
- package/dist/cjs/cli/logger.js +0 -27
- package/dist/esm/cli/logger.js +0 -7
- package/dist/esm-node/cli/logger.js +0 -7
- package/dist/types/cli/logger.d.ts +0 -2
|
@@ -40,7 +40,6 @@ var import_rspack = require("@module-federation/enhanced/rspack");
|
|
|
40
40
|
var import_universe_entry_chunk_tracker_plugin = __toESM(require("@module-federation/node/universe-entry-chunk-tracker-plugin"));
|
|
41
41
|
var import_manifest = require("./manifest");
|
|
42
42
|
var import_constant = require("./constant");
|
|
43
|
-
var import_logger = __toESM(require("./logger"));
|
|
44
43
|
function setEnv() {
|
|
45
44
|
process.env["MF_DISABLE_EMIT_STATS"] = "true";
|
|
46
45
|
process.env["MF_SSR_PRJ"] = "true";
|
|
@@ -124,7 +123,9 @@ const moduleFederationSSRPlugin = (userConfig) => ({
|
|
|
124
123
|
next();
|
|
125
124
|
}
|
|
126
125
|
} catch (err) {
|
|
127
|
-
|
|
126
|
+
if (process.env.FEDERATION_DEBUG) {
|
|
127
|
+
console.error(err);
|
|
128
|
+
}
|
|
128
129
|
next();
|
|
129
130
|
}
|
|
130
131
|
}
|
package/dist/cjs/cli/utils.js
CHANGED
|
@@ -40,7 +40,6 @@ var import_path = __toESM(require("path"));
|
|
|
40
40
|
var import_os = __toESM(require("os"));
|
|
41
41
|
var import_node_bundle_require = require("@modern-js/node-bundle-require");
|
|
42
42
|
var import_constant = require("../constant");
|
|
43
|
-
var import_logger = __toESM(require("./logger"));
|
|
44
43
|
const defaultPath = import_path.default.resolve(process.cwd(), "module-federation.config.ts");
|
|
45
44
|
const isDev = process.env.NODE_ENV === "development";
|
|
46
45
|
const getMFConfig = async (userConfig) => {
|
|
@@ -226,7 +225,7 @@ function patchBundlerConfig(options) {
|
|
|
226
225
|
}
|
|
227
226
|
if (!isServer && enableSSR && typeof ((_bundlerConfig_optimization1 = bundlerConfig.optimization) === null || _bundlerConfig_optimization1 === void 0 ? void 0 : _bundlerConfig_optimization1.splitChunks) === "object" && bundlerConfig.optimization.splitChunks.cacheGroups) {
|
|
228
227
|
bundlerConfig.optimization.splitChunks.chunks = "async";
|
|
229
|
-
|
|
228
|
+
console.warn(`${import_constant.PLUGIN_IDENTIFIER} splitChunks.chunks = async is not allowed with stream SSR mode, it will auto changed to "async"`);
|
|
230
229
|
}
|
|
231
230
|
if (isDev && ((_bundlerConfig_output = bundlerConfig.output) === null || _bundlerConfig_output === void 0 ? void 0 : _bundlerConfig_output.publicPath) === "auto") {
|
|
232
231
|
var _modernjsConfig_dev, _modernjsConfig_server1;
|
|
@@ -7,7 +7,6 @@ import { ModuleFederationPlugin as RspackModuleFederationPlugin } from "@module-
|
|
|
7
7
|
import UniverseEntryChunkTrackerPlugin from "@module-federation/node/universe-entry-chunk-tracker-plugin";
|
|
8
8
|
import { updateStatsAndManifest } from "./manifest";
|
|
9
9
|
import { isDev } from "./constant";
|
|
10
|
-
import logger from "./logger";
|
|
11
10
|
function setEnv() {
|
|
12
11
|
process.env["MF_DISABLE_EMIT_STATS"] = "true";
|
|
13
12
|
process.env["MF_SSR_PRJ"] = "true";
|
|
@@ -106,7 +105,9 @@ var moduleFederationSSRPlugin = function(userConfig) {
|
|
|
106
105
|
next();
|
|
107
106
|
}
|
|
108
107
|
} catch (err) {
|
|
109
|
-
|
|
108
|
+
if (process.env.FEDERATION_DEBUG) {
|
|
109
|
+
console.error(err);
|
|
110
|
+
}
|
|
110
111
|
next();
|
|
111
112
|
}
|
|
112
113
|
}
|
package/dist/esm/cli/utils.js
CHANGED
|
@@ -9,7 +9,6 @@ import path from "path";
|
|
|
9
9
|
import os from "os";
|
|
10
10
|
import { bundle } from "@modern-js/node-bundle-require";
|
|
11
11
|
import { LOCALHOST, PLUGIN_IDENTIFIER } from "../constant";
|
|
12
|
-
import logger from "./logger";
|
|
13
12
|
var defaultPath = path.resolve(process.cwd(), "module-federation.config.ts");
|
|
14
13
|
var isDev = process.env.NODE_ENV === "development";
|
|
15
14
|
var getMFConfig = function() {
|
|
@@ -222,7 +221,7 @@ function patchBundlerConfig(options) {
|
|
|
222
221
|
}
|
|
223
222
|
if (!isServer && enableSSR && _type_of((_bundlerConfig_optimization1 = bundlerConfig.optimization) === null || _bundlerConfig_optimization1 === void 0 ? void 0 : _bundlerConfig_optimization1.splitChunks) === "object" && bundlerConfig.optimization.splitChunks.cacheGroups) {
|
|
224
223
|
bundlerConfig.optimization.splitChunks.chunks = "async";
|
|
225
|
-
|
|
224
|
+
console.warn("".concat(PLUGIN_IDENTIFIER, ' splitChunks.chunks = async is not allowed with stream SSR mode, it will auto changed to "async"'));
|
|
226
225
|
}
|
|
227
226
|
if (isDev && ((_bundlerConfig_output = bundlerConfig.output) === null || _bundlerConfig_output === void 0 ? void 0 : _bundlerConfig_output.publicPath) === "auto") {
|
|
228
227
|
var _modernjsConfig_dev, _modernjsConfig_server1;
|
|
@@ -5,7 +5,6 @@ import { ModuleFederationPlugin as RspackModuleFederationPlugin } from "@module-
|
|
|
5
5
|
import UniverseEntryChunkTrackerPlugin from "@module-federation/node/universe-entry-chunk-tracker-plugin";
|
|
6
6
|
import { updateStatsAndManifest } from "./manifest";
|
|
7
7
|
import { isDev } from "./constant";
|
|
8
|
-
import logger from "./logger";
|
|
9
8
|
function setEnv() {
|
|
10
9
|
process.env["MF_DISABLE_EMIT_STATS"] = "true";
|
|
11
10
|
process.env["MF_SSR_PRJ"] = "true";
|
|
@@ -89,7 +88,9 @@ const moduleFederationSSRPlugin = (userConfig) => ({
|
|
|
89
88
|
next();
|
|
90
89
|
}
|
|
91
90
|
} catch (err) {
|
|
92
|
-
|
|
91
|
+
if (process.env.FEDERATION_DEBUG) {
|
|
92
|
+
console.error(err);
|
|
93
|
+
}
|
|
93
94
|
next();
|
|
94
95
|
}
|
|
95
96
|
}
|
|
@@ -3,7 +3,6 @@ import path from "path";
|
|
|
3
3
|
import os from "os";
|
|
4
4
|
import { bundle } from "@modern-js/node-bundle-require";
|
|
5
5
|
import { LOCALHOST, PLUGIN_IDENTIFIER } from "../constant";
|
|
6
|
-
import logger from "./logger";
|
|
7
6
|
const defaultPath = path.resolve(process.cwd(), "module-federation.config.ts");
|
|
8
7
|
const isDev = process.env.NODE_ENV === "development";
|
|
9
8
|
const getMFConfig = async (userConfig) => {
|
|
@@ -189,7 +188,7 @@ function patchBundlerConfig(options) {
|
|
|
189
188
|
}
|
|
190
189
|
if (!isServer && enableSSR && typeof ((_bundlerConfig_optimization1 = bundlerConfig.optimization) === null || _bundlerConfig_optimization1 === void 0 ? void 0 : _bundlerConfig_optimization1.splitChunks) === "object" && bundlerConfig.optimization.splitChunks.cacheGroups) {
|
|
191
190
|
bundlerConfig.optimization.splitChunks.chunks = "async";
|
|
192
|
-
|
|
191
|
+
console.warn(`${PLUGIN_IDENTIFIER} splitChunks.chunks = async is not allowed with stream SSR mode, it will auto changed to "async"`);
|
|
193
192
|
}
|
|
194
193
|
if (isDev && ((_bundlerConfig_output = bundlerConfig.output) === null || _bundlerConfig_output === void 0 ? void 0 : _bundlerConfig_output.publicPath) === "auto") {
|
|
195
194
|
var _modernjsConfig_dev, _modernjsConfig_server1;
|
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-20241101093646",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist/",
|
|
6
6
|
"types.d.ts",
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
"hoist-non-react-statics": "3.3.2",
|
|
62
62
|
"node-fetch": "~3.3.0",
|
|
63
63
|
"react-error-boundary": "4.0.13",
|
|
64
|
-
"@module-federation/enhanced": "0.0.0-next-
|
|
65
|
-
"@module-federation/node": "0.0.0-next-
|
|
66
|
-
"@module-federation/sdk": "0.0.0-next-
|
|
64
|
+
"@module-federation/enhanced": "0.0.0-next-20241101093646",
|
|
65
|
+
"@module-federation/node": "0.0.0-next-20241101093646",
|
|
66
|
+
"@module-federation/sdk": "0.0.0-next-20241101093646"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@modern-js/app-tools": "2.60.3",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"@modern-js/runtime": "2.60.3",
|
|
73
73
|
"@modern-js/tsconfig": "2.60.3",
|
|
74
74
|
"@types/hoist-non-react-statics": "3.3.5",
|
|
75
|
-
"@module-federation/manifest": "0.0.0-next-
|
|
75
|
+
"@module-federation/manifest": "0.0.0-next-20241101093646"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"react": ">=17",
|
package/dist/cjs/cli/logger.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var logger_exports = {};
|
|
20
|
-
__export(logger_exports, {
|
|
21
|
-
default: () => logger_default
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(logger_exports);
|
|
24
|
-
var import_sdk = require("@module-federation/sdk");
|
|
25
|
-
var import_constant = require("../constant");
|
|
26
|
-
const logger = (0, import_sdk.createLogger)(import_constant.PLUGIN_IDENTIFIER);
|
|
27
|
-
var logger_default = logger;
|
package/dist/esm/cli/logger.js
DELETED