@module-federation/modern-js 0.6.13 → 0.6.14
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/logger.js +27 -0
- package/dist/cjs/cli/ssrPlugin.js +2 -3
- package/dist/cjs/cli/utils.js +2 -1
- package/dist/esm/cli/logger.js +7 -0
- package/dist/esm/cli/ssrPlugin.js +2 -3
- package/dist/esm/cli/utils.js +2 -1
- package/dist/esm-node/cli/logger.js +7 -0
- package/dist/esm-node/cli/ssrPlugin.js +2 -3
- package/dist/esm-node/cli/utils.js +2 -1
- package/dist/types/cli/logger.d.ts +2 -0
- package/package.json +5 -5
|
@@ -0,0 +1,27 @@
|
|
|
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;
|
|
@@ -40,6 +40,7 @@ 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"));
|
|
43
44
|
function setEnv() {
|
|
44
45
|
process.env["MF_DISABLE_EMIT_STATS"] = "true";
|
|
45
46
|
process.env["MF_SSR_PRJ"] = "true";
|
|
@@ -123,9 +124,7 @@ const moduleFederationSSRPlugin = (userConfig) => ({
|
|
|
123
124
|
next();
|
|
124
125
|
}
|
|
125
126
|
} catch (err) {
|
|
126
|
-
|
|
127
|
-
console.error(err);
|
|
128
|
-
}
|
|
127
|
+
import_logger.default.debug(err);
|
|
129
128
|
next();
|
|
130
129
|
}
|
|
131
130
|
}
|
package/dist/cjs/cli/utils.js
CHANGED
|
@@ -40,6 +40,7 @@ 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"));
|
|
43
44
|
const defaultPath = import_path.default.resolve(process.cwd(), "module-federation.config.ts");
|
|
44
45
|
const isDev = process.env.NODE_ENV === "development";
|
|
45
46
|
const getMFConfig = async (userConfig) => {
|
|
@@ -225,7 +226,7 @@ function patchBundlerConfig(options) {
|
|
|
225
226
|
}
|
|
226
227
|
if (!isServer && enableSSR && typeof ((_bundlerConfig_optimization1 = bundlerConfig.optimization) === null || _bundlerConfig_optimization1 === void 0 ? void 0 : _bundlerConfig_optimization1.splitChunks) === "object" && bundlerConfig.optimization.splitChunks.cacheGroups) {
|
|
227
228
|
bundlerConfig.optimization.splitChunks.chunks = "async";
|
|
228
|
-
|
|
229
|
+
import_logger.default.warn(`splitChunks.chunks = async is not allowed with stream SSR mode, it will auto changed to "async"`);
|
|
229
230
|
}
|
|
230
231
|
if (isDev && ((_bundlerConfig_output = bundlerConfig.output) === null || _bundlerConfig_output === void 0 ? void 0 : _bundlerConfig_output.publicPath) === "auto") {
|
|
231
232
|
var _modernjsConfig_dev, _modernjsConfig_server1;
|
|
@@ -7,6 +7,7 @@ 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";
|
|
10
11
|
function setEnv() {
|
|
11
12
|
process.env["MF_DISABLE_EMIT_STATS"] = "true";
|
|
12
13
|
process.env["MF_SSR_PRJ"] = "true";
|
|
@@ -105,9 +106,7 @@ var moduleFederationSSRPlugin = function(userConfig) {
|
|
|
105
106
|
next();
|
|
106
107
|
}
|
|
107
108
|
} catch (err) {
|
|
108
|
-
|
|
109
|
-
console.error(err);
|
|
110
|
-
}
|
|
109
|
+
logger.debug(err);
|
|
111
110
|
next();
|
|
112
111
|
}
|
|
113
112
|
}
|
package/dist/esm/cli/utils.js
CHANGED
|
@@ -9,6 +9,7 @@ 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";
|
|
12
13
|
var defaultPath = path.resolve(process.cwd(), "module-federation.config.ts");
|
|
13
14
|
var isDev = process.env.NODE_ENV === "development";
|
|
14
15
|
var getMFConfig = function() {
|
|
@@ -221,7 +222,7 @@ function patchBundlerConfig(options) {
|
|
|
221
222
|
}
|
|
222
223
|
if (!isServer && enableSSR && _type_of((_bundlerConfig_optimization1 = bundlerConfig.optimization) === null || _bundlerConfig_optimization1 === void 0 ? void 0 : _bundlerConfig_optimization1.splitChunks) === "object" && bundlerConfig.optimization.splitChunks.cacheGroups) {
|
|
223
224
|
bundlerConfig.optimization.splitChunks.chunks = "async";
|
|
224
|
-
|
|
225
|
+
logger.warn('splitChunks.chunks = async is not allowed with stream SSR mode, it will auto changed to "async"');
|
|
225
226
|
}
|
|
226
227
|
if (isDev && ((_bundlerConfig_output = bundlerConfig.output) === null || _bundlerConfig_output === void 0 ? void 0 : _bundlerConfig_output.publicPath) === "auto") {
|
|
227
228
|
var _modernjsConfig_dev, _modernjsConfig_server1;
|
|
@@ -5,6 +5,7 @@ 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";
|
|
8
9
|
function setEnv() {
|
|
9
10
|
process.env["MF_DISABLE_EMIT_STATS"] = "true";
|
|
10
11
|
process.env["MF_SSR_PRJ"] = "true";
|
|
@@ -88,9 +89,7 @@ const moduleFederationSSRPlugin = (userConfig) => ({
|
|
|
88
89
|
next();
|
|
89
90
|
}
|
|
90
91
|
} catch (err) {
|
|
91
|
-
|
|
92
|
-
console.error(err);
|
|
93
|
-
}
|
|
92
|
+
logger.debug(err);
|
|
94
93
|
next();
|
|
95
94
|
}
|
|
96
95
|
}
|
|
@@ -3,6 +3,7 @@ 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";
|
|
6
7
|
const defaultPath = path.resolve(process.cwd(), "module-federation.config.ts");
|
|
7
8
|
const isDev = process.env.NODE_ENV === "development";
|
|
8
9
|
const getMFConfig = async (userConfig) => {
|
|
@@ -188,7 +189,7 @@ function patchBundlerConfig(options) {
|
|
|
188
189
|
}
|
|
189
190
|
if (!isServer && enableSSR && typeof ((_bundlerConfig_optimization1 = bundlerConfig.optimization) === null || _bundlerConfig_optimization1 === void 0 ? void 0 : _bundlerConfig_optimization1.splitChunks) === "object" && bundlerConfig.optimization.splitChunks.cacheGroups) {
|
|
190
191
|
bundlerConfig.optimization.splitChunks.chunks = "async";
|
|
191
|
-
|
|
192
|
+
logger.warn(`splitChunks.chunks = async is not allowed with stream SSR mode, it will auto changed to "async"`);
|
|
192
193
|
}
|
|
193
194
|
if (isDev && ((_bundlerConfig_output = bundlerConfig.output) === null || _bundlerConfig_output === void 0 ? void 0 : _bundlerConfig_output.publicPath) === "auto") {
|
|
194
195
|
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.6.
|
|
3
|
+
"version": "0.6.14",
|
|
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.6.
|
|
65
|
-
"@module-federation/node": "2.6.
|
|
66
|
-
"@module-federation/sdk": "0.6.
|
|
64
|
+
"@module-federation/enhanced": "0.6.14",
|
|
65
|
+
"@module-federation/node": "2.6.2",
|
|
66
|
+
"@module-federation/sdk": "0.6.14"
|
|
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.6.
|
|
75
|
+
"@module-federation/manifest": "0.6.14"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"react": ">=17",
|