@nx/module-federation 22.7.0-pr.35019.f500fd7 → 22.7.0-rc.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/package.json +7 -8
- package/src/plugins/nx-module-federation-plugin/angular/nx-module-federation-plugin.d.ts.map +1 -1
- package/src/plugins/nx-module-federation-plugin/angular/nx-module-federation-plugin.js +8 -0
- package/src/plugins/nx-module-federation-plugin/rspack/nx-module-federation-plugin.d.ts.map +1 -1
- package/src/plugins/nx-module-federation-plugin/rspack/nx-module-federation-plugin.js +8 -0
- package/src/plugins/utils/build-static-remotes.d.ts.map +1 -1
- package/src/plugins/utils/build-static-remotes.js +2 -6
- package/src/with-module-federation/angular/with-module-federation-ssr.d.ts.map +1 -1
- package/src/with-module-federation/angular/with-module-federation-ssr.js +5 -0
- package/src/with-module-federation/angular/with-module-federation.d.ts.map +1 -1
- package/src/with-module-federation/angular/with-module-federation.js +7 -0
- package/src/with-module-federation/rspack/with-module-federation-ssr.d.ts.map +1 -1
- package/src/with-module-federation/rspack/with-module-federation-ssr.js +7 -3
- package/src/with-module-federation/rspack/with-module-federation.d.ts.map +1 -1
- package/src/with-module-federation/rspack/with-module-federation.js +6 -0
- package/src/with-module-federation/webpack/with-module-federation-ssr.d.ts.map +1 -1
- package/src/with-module-federation/webpack/with-module-federation-ssr.js +6 -0
- package/src/with-module-federation/webpack/with-module-federation.d.ts.map +1 -1
- package/src/with-module-federation/webpack/with-module-federation.js +6 -0
- package/project.json +0 -52
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": "22.7.0-
|
|
4
|
+
"version": "22.7.0-rc.0",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
"main": "index.js",
|
|
25
25
|
"executors": "./executors.json",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@module-federation/enhanced": "^2.
|
|
27
|
+
"@module-federation/enhanced": "^2.3.3",
|
|
28
28
|
"@module-federation/node": "^2.7.21",
|
|
29
29
|
"@module-federation/sdk": "^2.1.0",
|
|
30
|
-
"@nx/devkit": "22.7.0-
|
|
31
|
-
"@nx/js": "22.7.0-
|
|
32
|
-
"@nx/web": "22.7.0-
|
|
30
|
+
"@nx/devkit": "22.7.0-rc.0",
|
|
31
|
+
"@nx/js": "22.7.0-rc.0",
|
|
32
|
+
"@nx/web": "22.7.0-rc.0",
|
|
33
33
|
"@rspack/core": "1.6.8",
|
|
34
34
|
"express": "^4.21.2",
|
|
35
35
|
"http-proxy-middleware": "^3.0.5",
|
|
@@ -38,13 +38,12 @@
|
|
|
38
38
|
"webpack": "^5.101.3"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"nx": "22.7.0-
|
|
41
|
+
"nx": "22.7.0-rc.0"
|
|
42
42
|
},
|
|
43
43
|
"nx-migrations": {
|
|
44
44
|
"migrations": "./migrations.json"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
48
|
-
}
|
|
49
|
-
"types": "./src/index.d.ts"
|
|
48
|
+
}
|
|
50
49
|
}
|
package/src/plugins/nx-module-federation-plugin/angular/nx-module-federation-plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nx-module-federation-plugin.d.ts","sourceRoot":"","sources":["../../../../../../../packages/module-federation/src/plugins/nx-module-federation-plugin/angular/nx-module-federation-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EACL,sBAAsB,EACtB,gCAAgC,EACjC,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"nx-module-federation-plugin.d.ts","sourceRoot":"","sources":["../../../../../../../packages/module-federation/src/plugins/nx-module-federation-plugin/angular/nx-module-federation-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EACL,sBAAsB,EACtB,gCAAgC,EACjC,MAAM,uBAAuB,CAAC;AAK/B,qBAAa,wBAAyB,YAAW,oBAAoB;IAEjE,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,cAAc,CAAC;gBAJf,QAAQ,EAAE;QAChB,MAAM,EAAE,sBAAsB,CAAC;QAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,EACO,cAAc,CAAC,EAAE,gCAAgC;IAG3D,KAAK,CAAC,QAAQ,EAAE,QAAQ;CA0FzB"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.NxModuleFederationPlugin = void 0;
|
|
4
4
|
const utils_1 = require("../../../with-module-federation/angular/utils");
|
|
5
5
|
const utils_2 = require("../../../utils");
|
|
6
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
7
|
class NxModuleFederationPlugin {
|
|
7
8
|
constructor(_options, configOverride) {
|
|
8
9
|
this._options = _options;
|
|
@@ -27,6 +28,13 @@ class NxModuleFederationPlugin {
|
|
|
27
28
|
? 'auto'
|
|
28
29
|
: compiler.options.output.publicPath;
|
|
29
30
|
compiler.options.output.uniqueName = this._options.config.name;
|
|
31
|
+
// Ensure workspace root is in resolve.modules so that expose paths
|
|
32
|
+
// like "apps/remote/src/..." resolve correctly without baseUrl.
|
|
33
|
+
compiler.options.resolve ??= {};
|
|
34
|
+
compiler.options.resolve.modules = [
|
|
35
|
+
...(compiler.options.resolve.modules ?? ['node_modules']),
|
|
36
|
+
devkit_1.workspaceRoot,
|
|
37
|
+
];
|
|
30
38
|
if (this._options.isServer) {
|
|
31
39
|
compiler.options.target = 'async-node';
|
|
32
40
|
compiler.options.output.library ??= {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nx-module-federation-plugin.d.ts","sourceRoot":"","sources":["../../../../../../../packages/module-federation/src/plugins/nx-module-federation-plugin/rspack/nx-module-federation-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EACL,sBAAsB,EACtB,gCAAgC,EACjC,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"nx-module-federation-plugin.d.ts","sourceRoot":"","sources":["../../../../../../../packages/module-federation/src/plugins/nx-module-federation-plugin/rspack/nx-module-federation-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EACL,sBAAsB,EACtB,gCAAgC,EACjC,MAAM,uBAAuB,CAAC;AAK/B,qBAAa,wBAAyB,YAAW,oBAAoB;IAEjE,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,cAAc,CAAC;gBAJf,QAAQ,EAAE;QAChB,MAAM,EAAE,sBAAsB,CAAC;QAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,EACO,cAAc,CAAC,EAAE,gCAAgC;IAG3D,KAAK,CAAC,QAAQ,EAAE,QAAQ;CA0EzB"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.NxModuleFederationPlugin = void 0;
|
|
4
4
|
const utils_1 = require("../../../with-module-federation/rspack/utils");
|
|
5
5
|
const utils_2 = require("../../../utils");
|
|
6
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
7
|
class NxModuleFederationPlugin {
|
|
7
8
|
constructor(_options, configOverride) {
|
|
8
9
|
this._options = _options;
|
|
@@ -21,6 +22,13 @@ class NxModuleFederationPlugin {
|
|
|
21
22
|
compiler.options.optimization.splitChunks.cacheGroups.common = false;
|
|
22
23
|
}
|
|
23
24
|
compiler.options.output.uniqueName = this._options.config.name;
|
|
25
|
+
// Ensure workspace root is in resolve.modules so that expose paths
|
|
26
|
+
// like "apps/remote/src/..." resolve correctly without baseUrl.
|
|
27
|
+
compiler.options.resolve ??= {};
|
|
28
|
+
compiler.options.resolve.modules = [
|
|
29
|
+
...(compiler.options.resolve.modules ?? ['node_modules']),
|
|
30
|
+
devkit_1.workspaceRoot,
|
|
31
|
+
];
|
|
24
32
|
if (compiler.options.output.scriptType === 'module') {
|
|
25
33
|
compiler.options.output.scriptType = undefined;
|
|
26
34
|
compiler.options.output.module = undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-static-remotes.d.ts","sourceRoot":"","sources":["../../../../../../packages/module-federation/src/plugins/utils/build-static-remotes.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,iCAAiC,EAAE,MAAM,WAAW,CAAC;AAE9D,wBAAsB,kBAAkB,CACtC,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,EACvD,OAAO,EAAE,iCAAiC,EAC1C,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"build-static-remotes.d.ts","sourceRoot":"","sources":["../../../../../../packages/module-federation/src/plugins/utils/build-static-remotes.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,iCAAiC,EAAE,MAAM,WAAW,CAAC;AAE9D,wBAAsB,kBAAkB,CACtC,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,EACvD,OAAO,EAAE,iCAAiC,EAC1C,KAAK,EAAE,MAAM,mCA2Ed"}
|
|
@@ -31,14 +31,10 @@ async function buildStaticRemotes(staticRemotesConfig, options, nxBin) {
|
|
|
31
31
|
},
|
|
32
32
|
});
|
|
33
33
|
// File to debug build failures e.g. 2024-01-01T00_00_0_0Z-build.log'
|
|
34
|
-
const remoteBuildLogFile = (0, path_1.join)(cache_directory_1.workspaceDataDirectory,
|
|
35
|
-
// eslint-disable-next-line
|
|
36
|
-
`${new Date().toISOString().replace(/[:\.]/g, '_')}-build.log`);
|
|
34
|
+
const remoteBuildLogFile = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, `${new Date().toISOString().replace(/[:\.]/g, '_')}-build.log`);
|
|
37
35
|
const stdoutStream = (0, node_fs_1.createWriteStream)(remoteBuildLogFile);
|
|
38
36
|
staticProcess.stdout?.on('data', (data) => {
|
|
39
|
-
const ANSII_CODE_REGEX =
|
|
40
|
-
// eslint-disable-next-line no-control-regex
|
|
41
|
-
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;
|
|
37
|
+
const ANSII_CODE_REGEX = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;
|
|
42
38
|
const stdoutString = data.toString().replace(ANSII_CODE_REGEX, '');
|
|
43
39
|
stdoutStream.write(stdoutString);
|
|
44
40
|
// in addition to writing into the stdout stream, also show error directly in console
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-module-federation-ssr.d.ts","sourceRoot":"","sources":["../../../../../../packages/module-federation/src/with-module-federation/angular/with-module-federation-ssr.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,gCAAgC,EACtC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"with-module-federation-ssr.d.ts","sourceRoot":"","sources":["../../../../../../packages/module-federation/src/with-module-federation/angular/with-module-federation-ssr.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,gCAAgC,EACtC,MAAM,aAAa,CAAC;AAIrB,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,sBAAsB,EAC/B,cAAc,CAAC,EAAE,gCAAgC,iCAgGlD"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.withModuleFederationForSSR = withModuleFederationForSSR;
|
|
4
4
|
const utils_1 = require("../../utils");
|
|
5
5
|
const utils_2 = require("./utils");
|
|
6
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
7
|
async function withModuleFederationForSSR(options, configOverride) {
|
|
7
8
|
if (global.NX_GRAPH_CREATION) {
|
|
8
9
|
return (config) => config;
|
|
@@ -27,6 +28,10 @@ async function withModuleFederationForSSR(options, configOverride) {
|
|
|
27
28
|
},
|
|
28
29
|
resolve: {
|
|
29
30
|
...(config.resolve ?? {}),
|
|
31
|
+
modules: [
|
|
32
|
+
...(config.resolve?.modules ?? ['node_modules']),
|
|
33
|
+
devkit_1.workspaceRoot,
|
|
34
|
+
],
|
|
30
35
|
alias: {
|
|
31
36
|
...(config.resolve?.alias ?? {}),
|
|
32
37
|
...sharedLibraries.getAliases(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-module-federation.d.ts","sourceRoot":"","sources":["../../../../../../packages/module-federation/src/with-module-federation/angular/with-module-federation.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,gCAAgC,EACtC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"with-module-federation.d.ts","sourceRoot":"","sources":["../../../../../../packages/module-federation/src/with-module-federation/angular/with-module-federation.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,gCAAgC,EACtC,MAAM,aAAa,CAAC;AAKrB,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,sBAAsB,EAC/B,cAAc,CAAC,EAAE,gCAAgC,iCAwFlD"}
|
|
@@ -4,6 +4,7 @@ exports.withModuleFederation = withModuleFederation;
|
|
|
4
4
|
const utils_1 = require("../../utils");
|
|
5
5
|
const utils_2 = require("./utils");
|
|
6
6
|
const webpack_1 = require("@module-federation/enhanced/webpack");
|
|
7
|
+
const devkit_1 = require("@nx/devkit");
|
|
7
8
|
async function withModuleFederation(options, configOverride) {
|
|
8
9
|
if (global.NX_GRAPH_CREATION) {
|
|
9
10
|
return (config) => config;
|
|
@@ -30,6 +31,12 @@ async function withModuleFederation(options, configOverride) {
|
|
|
30
31
|
},
|
|
31
32
|
resolve: {
|
|
32
33
|
...(config.resolve ?? {}),
|
|
34
|
+
// Ensure workspace root is in resolve.modules so that expose paths
|
|
35
|
+
// like "apps/remote/src/..." resolve correctly without baseUrl.
|
|
36
|
+
modules: [
|
|
37
|
+
...(config.resolve?.modules ?? ['node_modules']),
|
|
38
|
+
devkit_1.workspaceRoot,
|
|
39
|
+
],
|
|
33
40
|
alias: {
|
|
34
41
|
...(config.resolve?.alias ?? {}),
|
|
35
42
|
...sharedLibraries.getAliases(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-module-federation-ssr.d.ts","sourceRoot":"","sources":["../../../../../../packages/module-federation/src/with-module-federation/rspack/with-module-federation-ssr.ts"],"names":[],"mappings":"AACA,OAAO,EACL,sBAAsB,EAEtB,gCAAgC,EACjC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"with-module-federation-ssr.d.ts","sourceRoot":"","sources":["../../../../../../packages/module-federation/src/with-module-federation/rspack/with-module-federation-ssr.ts"],"names":[],"mappings":"AACA,OAAO,EACL,sBAAsB,EAEtB,gCAAgC,EACjC,MAAM,aAAa,CAAC;AAIrB,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,sBAAsB,EAC/B,cAAc,CAAC,EAAE,gCAAgC;;WAoFlD"}
|
|
@@ -4,6 +4,7 @@ exports.withModuleFederationForSSR = withModuleFederationForSSR;
|
|
|
4
4
|
const core_1 = require("@rspack/core");
|
|
5
5
|
const utils_1 = require("../../utils");
|
|
6
6
|
const utils_2 = require("./utils");
|
|
7
|
+
const devkit_1 = require("@nx/devkit");
|
|
7
8
|
async function withModuleFederationForSSR(options, configOverride) {
|
|
8
9
|
if (global.NX_GRAPH_CREATION) {
|
|
9
10
|
return (config) => config;
|
|
@@ -18,15 +19,18 @@ async function withModuleFederationForSSR(options, configOverride) {
|
|
|
18
19
|
config.output.library = {
|
|
19
20
|
type: 'commonjs-module',
|
|
20
21
|
};
|
|
22
|
+
config.resolve ??= {};
|
|
23
|
+
config.resolve.modules = [
|
|
24
|
+
...(config.resolve.modules ?? ['node_modules']),
|
|
25
|
+
devkit_1.workspaceRoot,
|
|
26
|
+
];
|
|
21
27
|
config.optimization = {
|
|
22
28
|
...(config.optimization ?? {}),
|
|
23
29
|
runtimeChunk: isDevServer
|
|
24
30
|
? (config.optimization?.runtimeChunk ?? undefined)
|
|
25
31
|
: false,
|
|
26
32
|
};
|
|
27
|
-
config.plugins.push(
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
29
|
-
new (require('@module-federation/enhanced/rspack').ModuleFederationPlugin)({
|
|
33
|
+
config.plugins.push(new (require('@module-federation/enhanced/rspack').ModuleFederationPlugin)({
|
|
30
34
|
name: (0, utils_1.normalizeProjectName)(options.name),
|
|
31
35
|
filename: 'remoteEntry.js',
|
|
32
36
|
exposes: options.exposes,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-module-federation.d.ts","sourceRoot":"","sources":["../../../../../../packages/module-federation/src/with-module-federation/rspack/with-module-federation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EACL,sBAAsB,EAEtB,gCAAgC,EACjC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"with-module-federation.d.ts","sourceRoot":"","sources":["../../../../../../packages/module-federation/src/with-module-federation/rspack/with-module-federation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EACL,sBAAsB,EAEtB,gCAAgC,EACjC,MAAM,aAAa,CAAC;AAOrB;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,sBAAsB,EAC/B,cAAc,CAAC,EAAE,gCAAgC,oBAcvC,aAAa;;MAEpB,aAAa,EAyEjB"}
|
|
@@ -5,6 +5,7 @@ const rspack_1 = require("@module-federation/enhanced/rspack");
|
|
|
5
5
|
const core_1 = require("@rspack/core");
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
7
|
const utils_2 = require("./utils");
|
|
8
|
+
const devkit_1 = require("@nx/devkit");
|
|
8
9
|
const isVarOrWindow = (libType) => libType === 'var' || libType === 'window';
|
|
9
10
|
/**
|
|
10
11
|
* @param {ModuleFederationConfig} options
|
|
@@ -25,6 +26,11 @@ async function withModuleFederation(options, configOverride) {
|
|
|
25
26
|
if (isGlobal) {
|
|
26
27
|
config.output.scriptType = 'text/javascript';
|
|
27
28
|
}
|
|
29
|
+
config.resolve ??= {};
|
|
30
|
+
config.resolve.modules = [
|
|
31
|
+
...(config.resolve.modules ?? ['node_modules']),
|
|
32
|
+
devkit_1.workspaceRoot,
|
|
33
|
+
];
|
|
28
34
|
config.optimization = {
|
|
29
35
|
...(config.optimization ?? {}),
|
|
30
36
|
runtimeChunk: isDevServer && !options.exposes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-module-federation-ssr.d.ts","sourceRoot":"","sources":["../../../../../../packages/module-federation/src/with-module-federation/webpack/with-module-federation-ssr.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EAEtB,gCAAgC,EACjC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"with-module-federation-ssr.d.ts","sourceRoot":"","sources":["../../../../../../packages/module-federation/src/with-module-federation/webpack/with-module-federation-ssr.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EAEtB,gCAAgC,EACjC,MAAM,aAAa,CAAC;AAKrB,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,sBAAsB,EAC/B,cAAc,CAAC,EAAE,gCAAgC,iCAmFlD"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.withModuleFederationForSSR = withModuleFederationForSSR;
|
|
4
4
|
const utils_1 = require("../../utils");
|
|
5
5
|
const utils_2 = require("./utils");
|
|
6
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
7
|
async function withModuleFederationForSSR(options, configOverride) {
|
|
7
8
|
if (global.NX_GRAPH_CREATION) {
|
|
8
9
|
return (config) => config;
|
|
@@ -14,6 +15,11 @@ async function withModuleFederationForSSR(options, configOverride) {
|
|
|
14
15
|
return (config) => {
|
|
15
16
|
config.target = 'async-node';
|
|
16
17
|
config.output.uniqueName = options.name;
|
|
18
|
+
config.resolve ??= {};
|
|
19
|
+
config.resolve.modules = [
|
|
20
|
+
...(config.resolve.modules ?? ['node_modules']),
|
|
21
|
+
devkit_1.workspaceRoot,
|
|
22
|
+
];
|
|
17
23
|
config.optimization = {
|
|
18
24
|
...(config.optimization ?? {}),
|
|
19
25
|
runtimeChunk: isDevServer
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-module-federation.d.ts","sourceRoot":"","sources":["../../../../../../packages/module-federation/src/with-module-federation/webpack/with-module-federation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EAEtB,gCAAgC,EACjC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"with-module-federation.d.ts","sourceRoot":"","sources":["../../../../../../packages/module-federation/src/with-module-federation/webpack/with-module-federation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EAEtB,gCAAgC,EACjC,MAAM,aAAa,CAAC;AAMrB;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,sBAAsB,EAC/B,cAAc,CAAC,EAAE,gCAAgC,2CAgFlD"}
|
|
@@ -4,6 +4,7 @@ exports.withModuleFederation = withModuleFederation;
|
|
|
4
4
|
const utils_1 = require("../../utils");
|
|
5
5
|
const utils_2 = require("./utils");
|
|
6
6
|
const webpack_1 = require("@module-federation/enhanced/webpack");
|
|
7
|
+
const devkit_1 = require("@nx/devkit");
|
|
7
8
|
/**
|
|
8
9
|
* @param {ModuleFederationConfig} options
|
|
9
10
|
*/
|
|
@@ -17,6 +18,11 @@ async function withModuleFederation(options, configOverride) {
|
|
|
17
18
|
config.output.uniqueName = options.name;
|
|
18
19
|
config.output.publicPath = 'auto';
|
|
19
20
|
config.output.scriptType = 'text/javascript';
|
|
21
|
+
config.resolve ??= {};
|
|
22
|
+
config.resolve.modules = [
|
|
23
|
+
...(config.resolve.modules ?? ['node_modules']),
|
|
24
|
+
devkit_1.workspaceRoot,
|
|
25
|
+
];
|
|
20
26
|
config.optimization = {
|
|
21
27
|
...(config.optimization ?? {}),
|
|
22
28
|
runtimeChunk: isDevServer && !options.exposes
|
package/project.json
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "module-federation",
|
|
3
|
-
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
-
"sourceRoot": "packages/module-federation",
|
|
5
|
-
"projectType": "library",
|
|
6
|
-
"targets": {
|
|
7
|
-
"build": {
|
|
8
|
-
"outputs": ["{workspaceRoot}/dist/packages/module-federation/README.md"],
|
|
9
|
-
"command": "node ./scripts/copy-readme.js module-federation"
|
|
10
|
-
},
|
|
11
|
-
"legacy-post-build": {
|
|
12
|
-
"executor": "@nx/workspace-plugin:legacy-post-build",
|
|
13
|
-
"options": {
|
|
14
|
-
"tsConfig": "./tsconfig.lib.json",
|
|
15
|
-
"assets": [
|
|
16
|
-
{
|
|
17
|
-
"input": "packages/module-federation",
|
|
18
|
-
"glob": "**/files/**",
|
|
19
|
-
"output": "/"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"input": "packages/module-federation",
|
|
23
|
-
"glob": "**/files/**/.gitkeep",
|
|
24
|
-
"output": "/"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"input": "packages/module-federation",
|
|
28
|
-
"glob": "**/*.json",
|
|
29
|
-
"ignore": ["**/tsconfig*.json", "project.json", ".eslintrc.json"],
|
|
30
|
-
"output": "/"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"input": "packages/module-federation",
|
|
34
|
-
"glob": "**/*.js",
|
|
35
|
-
"ignore": ["**/jest.config.js"],
|
|
36
|
-
"output": "/"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"input": "packages/module-federation",
|
|
40
|
-
"glob": "**/*.d.ts",
|
|
41
|
-
"output": "/"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"input": "",
|
|
45
|
-
"glob": "LICENSE",
|
|
46
|
-
"output": "/"
|
|
47
|
-
}
|
|
48
|
-
]
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|