@nx/module-federation 21.1.0 → 21.1.2
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/package.json +4 -4
- package/src/with-module-federation/angular/with-module-federation-ssr.js +4 -0
- package/src/with-module-federation/angular/with-module-federation.js +4 -0
- package/src/with-module-federation/rspack/with-module-federation-ssr.js +4 -0
- package/src/with-module-federation/rspack/with-module-federation.js +4 -0
- package/src/with-module-federation/webpack/with-module-federation-ssr.js +4 -0
- package/src/with-module-federation/webpack/with-module-federation.js +4 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/module-federation",
|
|
3
3
|
"description": "The Nx Plugin for Module Federation contains executors and utilities that support building applications using Module Federation.",
|
|
4
|
-
"version": "21.1.
|
|
4
|
+
"version": "21.1.2",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"executors": "./executors.json",
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"tslib": "^2.3.0",
|
|
28
|
-
"@nx/devkit": "21.1.
|
|
29
|
-
"@nx/js": "21.1.
|
|
30
|
-
"@nx/web": "21.1.
|
|
28
|
+
"@nx/devkit": "21.1.2",
|
|
29
|
+
"@nx/js": "21.1.2",
|
|
30
|
+
"@nx/web": "21.1.2",
|
|
31
31
|
"picocolors": "^1.1.0",
|
|
32
32
|
"webpack": "^5.88.0",
|
|
33
33
|
"@rspack/core": "^1.3.8",
|
|
@@ -6,6 +6,7 @@ async function withModuleFederationForSSR(options, configOverride) {
|
|
|
6
6
|
if (global.NX_GRAPH_CREATION) {
|
|
7
7
|
return (config) => config;
|
|
8
8
|
}
|
|
9
|
+
const isDevServer = process.env['WEBPACK_SERVE'];
|
|
9
10
|
const { sharedLibraries, sharedDependencies, mappedRemotes } = await (0, utils_1.getModuleFederationConfig)(options, {
|
|
10
11
|
isServer: true,
|
|
11
12
|
});
|
|
@@ -19,6 +20,9 @@ async function withModuleFederationForSSR(options, configOverride) {
|
|
|
19
20
|
},
|
|
20
21
|
optimization: {
|
|
21
22
|
...(config.optimization ?? {}),
|
|
23
|
+
runtimeChunk: isDevServer
|
|
24
|
+
? config.optimization?.runtimeChunk ?? undefined
|
|
25
|
+
: false,
|
|
22
26
|
},
|
|
23
27
|
resolve: {
|
|
24
28
|
...(config.resolve ?? {}),
|
|
@@ -7,6 +7,7 @@ async function withModuleFederation(options, configOverride) {
|
|
|
7
7
|
if (global.NX_GRAPH_CREATION) {
|
|
8
8
|
return (config) => config;
|
|
9
9
|
}
|
|
10
|
+
const isDevServer = process.env['WEBPACK_SERVE'];
|
|
10
11
|
const { sharedLibraries, sharedDependencies, mappedRemotes } = await (0, utils_1.getModuleFederationConfig)(options);
|
|
11
12
|
return (config) => {
|
|
12
13
|
const updatedConfig = {
|
|
@@ -18,6 +19,9 @@ async function withModuleFederation(options, configOverride) {
|
|
|
18
19
|
},
|
|
19
20
|
optimization: {
|
|
20
21
|
...(config.optimization ?? {}),
|
|
22
|
+
runtimeChunk: isDevServer
|
|
23
|
+
? config.optimization?.runtimeChunk ?? undefined
|
|
24
|
+
: false,
|
|
21
25
|
},
|
|
22
26
|
resolve: {
|
|
23
27
|
...(config.resolve ?? {}),
|
|
@@ -7,6 +7,7 @@ async function withModuleFederationForSSR(options, configOverride) {
|
|
|
7
7
|
if (global.NX_GRAPH_CREATION) {
|
|
8
8
|
return (config) => config;
|
|
9
9
|
}
|
|
10
|
+
const isDevServer = process.env['WEBPACK_SERVE'];
|
|
10
11
|
const { sharedLibraries, sharedDependencies, mappedRemotes } = (0, utils_1.getModuleFederationConfig)(options, {
|
|
11
12
|
isServer: true,
|
|
12
13
|
});
|
|
@@ -18,6 +19,9 @@ async function withModuleFederationForSSR(options, configOverride) {
|
|
|
18
19
|
};
|
|
19
20
|
config.optimization = {
|
|
20
21
|
...(config.optimization ?? {}),
|
|
22
|
+
runtimeChunk: isDevServer
|
|
23
|
+
? config.optimization?.runtimeChunk ?? undefined
|
|
24
|
+
: false,
|
|
21
25
|
};
|
|
22
26
|
config.plugins.push(
|
|
23
27
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
@@ -15,6 +15,7 @@ async function withModuleFederation(options, configOverride) {
|
|
|
15
15
|
return config;
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
+
const isDevServer = process.env['WEBPACK_SERVE'];
|
|
18
19
|
const { sharedDependencies, sharedLibraries, mappedRemotes } = (0, utils_1.getModuleFederationConfig)(options);
|
|
19
20
|
const isGlobal = isVarOrWindow(options.library?.type);
|
|
20
21
|
return function makeConfig(config, { context }) {
|
|
@@ -25,6 +26,9 @@ async function withModuleFederation(options, configOverride) {
|
|
|
25
26
|
}
|
|
26
27
|
config.optimization = {
|
|
27
28
|
...(config.optimization ?? {}),
|
|
29
|
+
runtimeChunk: isDevServer
|
|
30
|
+
? config.optimization?.runtimeChunk ?? undefined
|
|
31
|
+
: false,
|
|
28
32
|
};
|
|
29
33
|
if (config.mode === 'development' &&
|
|
30
34
|
Object.keys(mappedRemotes).length > 1 &&
|
|
@@ -6,6 +6,7 @@ async function withModuleFederationForSSR(options, configOverride) {
|
|
|
6
6
|
if (global.NX_GRAPH_CREATION) {
|
|
7
7
|
return (config) => config;
|
|
8
8
|
}
|
|
9
|
+
const isDevServer = process.env['WEBPACK_SERVE'];
|
|
9
10
|
const { sharedLibraries, sharedDependencies, mappedRemotes } = await (0, utils_1.getModuleFederationConfig)(options, {
|
|
10
11
|
isServer: true,
|
|
11
12
|
});
|
|
@@ -14,6 +15,9 @@ async function withModuleFederationForSSR(options, configOverride) {
|
|
|
14
15
|
config.output.uniqueName = options.name;
|
|
15
16
|
config.optimization = {
|
|
16
17
|
...(config.optimization ?? {}),
|
|
18
|
+
runtimeChunk: isDevServer
|
|
19
|
+
? config.optimization?.runtimeChunk ?? undefined
|
|
20
|
+
: false,
|
|
17
21
|
};
|
|
18
22
|
config.plugins.push(new (require('@module-federation/enhanced').ModuleFederationPlugin)({
|
|
19
23
|
name: options.name.replace(/-/g, '_'),
|
|
@@ -10,6 +10,7 @@ async function withModuleFederation(options, configOverride) {
|
|
|
10
10
|
if (global.NX_GRAPH_CREATION) {
|
|
11
11
|
return (config) => config;
|
|
12
12
|
}
|
|
13
|
+
const isDevServer = process.env['WEBPACK_SERVE'];
|
|
13
14
|
const { sharedDependencies, sharedLibraries, mappedRemotes } = await (0, utils_1.getModuleFederationConfig)(options);
|
|
14
15
|
return (config, ctx) => {
|
|
15
16
|
config.output.uniqueName = options.name;
|
|
@@ -17,6 +18,9 @@ async function withModuleFederation(options, configOverride) {
|
|
|
17
18
|
config.output.scriptType = 'text/javascript';
|
|
18
19
|
config.optimization = {
|
|
19
20
|
...(config.optimization ?? {}),
|
|
21
|
+
runtimeChunk: isDevServer
|
|
22
|
+
? config.optimization?.runtimeChunk ?? undefined
|
|
23
|
+
: false,
|
|
20
24
|
};
|
|
21
25
|
if (config.mode === 'development' &&
|
|
22
26
|
Object.keys(mappedRemotes).length > 1 &&
|