@nx/rspack 23.0.0-beta.2 → 23.0.0-beta.20
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/migrations.json +52 -8
- package/package.json +27 -13
- package/src/executors/dev-server/dev-server.impl.d.ts.map +1 -1
- package/src/executors/dev-server/dev-server.impl.js +6 -4
- package/src/executors/dev-server/schema.json +1 -0
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +4 -4
- package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +4 -4
- package/src/executors/module-federation-static-server/module-federation-static-server.impl.js +4 -4
- package/src/executors/rspack/lib/normalize-options.js +2 -2
- package/src/executors/rspack/rspack.impl.d.ts.map +1 -1
- package/src/executors/rspack/rspack.impl.js +6 -4
- package/src/executors/rspack/schema.json +1 -0
- package/src/executors/ssr-dev-server/ssr-dev-server.impl.d.ts.map +1 -1
- package/src/executors/ssr-dev-server/ssr-dev-server.impl.js +2 -2
- package/src/generators/configuration/configuration.d.ts.map +1 -1
- package/src/generators/configuration/configuration.js +13 -10
- package/src/generators/convert-config-to-rspack-plugin/convert-config-to-rspack-plugin.d.ts.map +1 -1
- package/src/generators/convert-config-to-rspack-plugin/convert-config-to-rspack-plugin.js +5 -7
- package/src/generators/convert-to-inferred/convert-to-inferred.d.ts.map +1 -1
- package/src/generators/convert-to-inferred/convert-to-inferred.js +13 -6
- package/src/generators/convert-to-inferred/utils/build-post-target-transformer.js +8 -8
- package/src/generators/convert-to-inferred/utils/serve-post-target-transformer.d.ts.map +1 -1
- package/src/generators/convert-to-inferred/utils/serve-post-target-transformer.js +4 -4
- package/src/generators/convert-to-inferred/utils/types.d.ts +1 -1
- package/src/generators/convert-to-inferred/utils/types.d.ts.map +1 -1
- package/src/generators/convert-webpack/convert-webpack.d.ts.map +1 -1
- package/src/generators/convert-webpack/convert-webpack.js +8 -1
- package/src/generators/init/init.d.ts.map +1 -1
- package/src/generators/init/init.js +14 -7
- package/src/generators/init/schema.json +1 -1
- package/src/migrations/update-20-2-0/migrate-with-mf-import-to-new-package.d.ts.map +1 -1
- package/src/migrations/update-20-2-0/migrate-with-mf-import-to-new-package.js +2 -2
- package/src/migrations/update-20-3-0/ensure-nx-module-federation-package.d.ts.map +1 -1
- package/src/migrations/update-20-3-0/ensure-nx-module-federation-package.js +2 -2
- package/src/migrations/update-22-0-0/remove-deprecated-options.d.ts.map +1 -1
- package/src/migrations/update-22-0-0/remove-deprecated-options.js +3 -3
- package/src/migrations/update-23-0-0/add-svgr-to-rspack-config.d.ts +3 -0
- package/src/migrations/update-23-0-0/add-svgr-to-rspack-config.d.ts.map +1 -0
- package/src/migrations/update-23-0-0/add-svgr-to-rspack-config.js +413 -0
- package/src/migrations/update-23-0-0/add-svgr-to-rspack-config.md +84 -0
- package/src/plugins/nx-react-rspack-plugin/nx-react-rspack-plugin.d.ts +1 -7
- package/src/plugins/nx-react-rspack-plugin/nx-react-rspack-plugin.d.ts.map +1 -1
- package/src/plugins/plugin.d.ts.map +1 -1
- package/src/plugins/plugin.js +17 -27
- package/src/plugins/utils/apply-base-config.js +2 -2
- package/src/plugins/utils/apply-react-config.d.ts +1 -4
- package/src/plugins/utils/apply-react-config.d.ts.map +1 -1
- package/src/plugins/utils/apply-react-config.js +1 -32
- package/src/plugins/utils/apply-web-config.d.ts.map +1 -1
- package/src/plugins/utils/apply-web-config.js +4 -14
- package/src/plugins/utils/models.d.ts +1 -10
- package/src/plugins/utils/models.d.ts.map +1 -1
- package/src/plugins/utils/plugins/normalize-options.js +2 -2
- package/src/plugins/utils/plugins/nx-tsconfig-paths-rspack-plugin.js +3 -3
- package/src/utils/assert-supported-rspack-version.d.ts +3 -0
- package/src/utils/assert-supported-rspack-version.d.ts.map +1 -0
- package/src/utils/assert-supported-rspack-version.js +8 -0
- package/src/utils/config.js +2 -2
- package/src/utils/deprecation.d.ts +6 -0
- package/src/utils/deprecation.d.ts.map +1 -0
- package/src/utils/deprecation.js +21 -0
- package/src/utils/e2e-web-server-info-utils.d.ts +1 -1
- package/src/utils/e2e-web-server-info-utils.d.ts.map +1 -1
- package/src/utils/e2e-web-server-info-utils.js +6 -5
- package/src/utils/generator-utils.d.ts.map +1 -1
- package/src/utils/generator-utils.js +3 -4
- package/src/utils/resolve-user-defined-rspack-config.js +2 -2
- package/src/utils/version-utils.d.ts +27 -0
- package/src/utils/version-utils.d.ts.map +1 -0
- package/src/utils/version-utils.js +53 -0
- package/src/utils/versions.d.ts +18 -3
- package/src/utils/versions.d.ts.map +1 -1
- package/src/utils/versions.js +21 -4
- package/src/utils/with-react.d.ts +1 -7
- package/src/utils/with-react.d.ts.map +1 -1
- package/src/utils/with-react.js +1 -1
- package/src/utils/with-web.d.ts +1 -1
- package/src/utils/with-web.d.ts.map +1 -1
package/migrations.json
CHANGED
|
@@ -17,6 +17,12 @@
|
|
|
17
17
|
"version": "22.0.0-beta.1",
|
|
18
18
|
"description": "Remove deprecated deleteOutputPath and sassImplementation options from rspack configurations.",
|
|
19
19
|
"factory": "./src/migrations/update-22-0-0/remove-deprecated-options"
|
|
20
|
+
},
|
|
21
|
+
"update-23-0-0-add-svgr-to-rspack-config": {
|
|
22
|
+
"cli": "nx",
|
|
23
|
+
"version": "23.0.0-beta.9",
|
|
24
|
+
"description": "Updates rspack configs using React to use the new withSvgr composable function instead of the svgr option in withReact or NxReactRspackPlugin.",
|
|
25
|
+
"factory": "./src/migrations/update-23-0-0/add-svgr-to-rspack-config"
|
|
20
26
|
}
|
|
21
27
|
},
|
|
22
28
|
"packageJsonUpdates": {
|
|
@@ -59,13 +65,24 @@
|
|
|
59
65
|
}
|
|
60
66
|
}
|
|
61
67
|
},
|
|
62
|
-
"21.3.0": {
|
|
68
|
+
"21.3.0-module-federation-enhanced": {
|
|
63
69
|
"version": "21.3.0-beta.8",
|
|
70
|
+
"requires": {
|
|
71
|
+
"@module-federation/enhanced": ">=0.15.0 <0.17.0"
|
|
72
|
+
},
|
|
64
73
|
"packages": {
|
|
65
74
|
"@module-federation/enhanced": {
|
|
66
75
|
"version": "^0.17.0",
|
|
67
76
|
"alwaysAddToPackageJson": false
|
|
68
|
-
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"21.3.0-module-federation-node": {
|
|
81
|
+
"version": "21.3.0-beta.8",
|
|
82
|
+
"requires": {
|
|
83
|
+
"@module-federation/node": "<2.7.9"
|
|
84
|
+
},
|
|
85
|
+
"packages": {
|
|
69
86
|
"@module-federation/node": {
|
|
70
87
|
"version": "^2.7.9",
|
|
71
88
|
"alwaysAddToPackageJson": false
|
|
@@ -94,21 +111,48 @@
|
|
|
94
111
|
}
|
|
95
112
|
}
|
|
96
113
|
},
|
|
97
|
-
"22.2.0": {
|
|
114
|
+
"22.2.0-module-federation-enhanced": {
|
|
98
115
|
"version": "22.2.0-beta.0",
|
|
116
|
+
"requires": {
|
|
117
|
+
"@module-federation/enhanced": ">=0.17.0 <0.21.0"
|
|
118
|
+
},
|
|
99
119
|
"packages": {
|
|
100
120
|
"@module-federation/enhanced": {
|
|
101
121
|
"version": "^0.21.2",
|
|
102
122
|
"alwaysAddToPackageJson": false
|
|
103
|
-
}
|
|
104
|
-
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"22.2.0-module-federation-sdk": {
|
|
127
|
+
"version": "22.2.0-beta.0",
|
|
128
|
+
"requires": {
|
|
129
|
+
"@module-federation/sdk": ">=0.17.0 <0.21.0"
|
|
130
|
+
},
|
|
131
|
+
"packages": {
|
|
132
|
+
"@module-federation/sdk": {
|
|
105
133
|
"version": "^0.21.2",
|
|
106
134
|
"alwaysAddToPackageJson": false
|
|
107
|
-
}
|
|
108
|
-
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"22.2.0-module-federation-runtime": {
|
|
139
|
+
"version": "22.2.0-beta.0",
|
|
140
|
+
"requires": {
|
|
141
|
+
"@module-federation/runtime": "<0.21.0"
|
|
142
|
+
},
|
|
143
|
+
"packages": {
|
|
144
|
+
"@module-federation/runtime": {
|
|
109
145
|
"version": "^0.21.2",
|
|
110
146
|
"alwaysAddToPackageJson": false
|
|
111
|
-
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"22.2.0-module-federation-node": {
|
|
151
|
+
"version": "22.2.0-beta.0",
|
|
152
|
+
"requires": {
|
|
153
|
+
"@module-federation/node": "<2.7.21"
|
|
154
|
+
},
|
|
155
|
+
"packages": {
|
|
112
156
|
"@module-federation/node": {
|
|
113
157
|
"version": "^2.7.21",
|
|
114
158
|
"alwaysAddToPackageJson": false
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/rspack",
|
|
3
3
|
"description": "The Nx Plugin for Rspack contains executors and generators that support building applications using Rspack.",
|
|
4
|
-
"version": "23.0.0-beta.
|
|
4
|
+
"version": "23.0.0-beta.20",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -24,14 +24,11 @@
|
|
|
24
24
|
"generators": "./generators.json",
|
|
25
25
|
"executors": "./executors.json",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@nx/devkit": "23.0.0-beta.
|
|
28
|
-
"@nx/js": "23.0.0-beta.
|
|
29
|
-
"@nx/module-federation": "23.0.0-beta.
|
|
30
|
-
"@nx/web": "23.0.0-beta.
|
|
31
|
-
"@phenomnomnominal/tsquery": "~6.
|
|
32
|
-
"@rspack/core": "1.6.8",
|
|
33
|
-
"@rspack/dev-server": "^1.1.4",
|
|
34
|
-
"@rspack/plugin-react-refresh": "^1.0.0",
|
|
27
|
+
"@nx/devkit": "23.0.0-beta.20",
|
|
28
|
+
"@nx/js": "23.0.0-beta.20",
|
|
29
|
+
"@nx/module-federation": "23.0.0-beta.20",
|
|
30
|
+
"@nx/web": "23.0.0-beta.20",
|
|
31
|
+
"@phenomnomnominal/tsquery": "~6.2.0",
|
|
35
32
|
"autoprefixer": "^10.4.9",
|
|
36
33
|
"browserslist": "^4.26.0",
|
|
37
34
|
"css-loader": "^6.4.0",
|
|
@@ -49,6 +46,7 @@
|
|
|
49
46
|
"sass": "^1.97.2",
|
|
50
47
|
"sass-embedded": "^1.97.2",
|
|
51
48
|
"sass-loader": "^16.0.7",
|
|
49
|
+
"semver": "^7.6.3",
|
|
52
50
|
"source-map-loader": "^5.0.0",
|
|
53
51
|
"style-loader": "^3.3.0",
|
|
54
52
|
"ts-checker-rspack-plugin": "^1.1.1",
|
|
@@ -57,12 +55,28 @@
|
|
|
57
55
|
"webpack-node-externals": "^3.0.0"
|
|
58
56
|
},
|
|
59
57
|
"devDependencies": {
|
|
60
|
-
"nx": "23.0.0-beta.
|
|
61
|
-
"@nx/nest": "23.0.0-beta.
|
|
58
|
+
"nx": "23.0.0-beta.20",
|
|
59
|
+
"@nx/nest": "23.0.0-beta.20"
|
|
62
60
|
},
|
|
63
61
|
"peerDependencies": {
|
|
64
|
-
"@
|
|
65
|
-
"@
|
|
62
|
+
"@rspack/cli": "^1.0.0",
|
|
63
|
+
"@rspack/core": "^1.0.0",
|
|
64
|
+
"@rspack/dev-server": "^1.0.0",
|
|
65
|
+
"@rspack/plugin-react-refresh": "^1.0.0"
|
|
66
|
+
},
|
|
67
|
+
"peerDependenciesMeta": {
|
|
68
|
+
"@rspack/cli": {
|
|
69
|
+
"optional": true
|
|
70
|
+
},
|
|
71
|
+
"@rspack/core": {
|
|
72
|
+
"optional": true
|
|
73
|
+
},
|
|
74
|
+
"@rspack/dev-server": {
|
|
75
|
+
"optional": true
|
|
76
|
+
},
|
|
77
|
+
"@rspack/plugin-react-refresh": {
|
|
78
|
+
"optional": true
|
|
79
|
+
}
|
|
66
80
|
},
|
|
67
81
|
"nx-migrations": {
|
|
68
82
|
"migrations": "./migrations.json"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-server.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/executors/dev-server/dev-server.impl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dev-server.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/executors/dev-server/dev-server.impl.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EAIhB,MAAM,YAAY,CAAC;AAQpB,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAInD,wBAA+B,WAAW,CACxC,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,eAAe,GACvB,qBAAqB,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CA4E/D"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = runExecutor;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
6
|
-
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
6
|
+
const internal_2 = require("@nx/js/internal");
|
|
7
7
|
const dev_server_1 = require("@rspack/dev-server");
|
|
8
8
|
const create_compiler_1 = require("../../utils/create-compiler");
|
|
9
9
|
const mode_utils_1 = require("../../utils/mode-utils");
|
|
10
10
|
const normalize_options_1 = require("../rspack/lib/normalize-options");
|
|
11
11
|
const get_dev_server_config_1 = require("./lib/get-dev-server-config");
|
|
12
|
+
const deprecation_1 = require("../../utils/deprecation");
|
|
12
13
|
async function* runExecutor(options, context) {
|
|
14
|
+
(0, deprecation_1.warnRspackDevServerExecutorDeprecation)();
|
|
13
15
|
process.env.NODE_ENV ??= options.mode ?? 'development';
|
|
14
16
|
if ((0, mode_utils_1.isMode)(process.env.NODE_ENV)) {
|
|
15
17
|
options.mode = process.env.NODE_ENV;
|
|
@@ -19,7 +21,7 @@ async function* runExecutor(options, context) {
|
|
|
19
21
|
process.env.NX_BUILD_LIBS_FROM_SOURCE = `${buildOptions.buildLibsFromSource}`;
|
|
20
22
|
process.env.NX_BUILD_TARGET = options.buildTarget;
|
|
21
23
|
const metadata = context.projectsConfigurations.projects[context.projectName];
|
|
22
|
-
const sourceRoot = (0,
|
|
24
|
+
const sourceRoot = (0, internal_2.getProjectSourceRoot)(metadata);
|
|
23
25
|
const normalizedBuildOptions = (0, normalize_options_1.normalizeOptions)(buildOptions, context.root, metadata.root, sourceRoot);
|
|
24
26
|
let devServerConfig = (0, get_dev_server_config_1.getDevServerOptions)(context.root, options, normalizedBuildOptions);
|
|
25
27
|
const compiler = await (0, create_compiler_1.createCompiler)({
|
|
@@ -37,7 +39,7 @@ async function* runExecutor(options, context) {
|
|
|
37
39
|
...firstCompiler.options.devServer,
|
|
38
40
|
};
|
|
39
41
|
const baseUrl = `http://localhost:${devServerConfig.port ?? 4200}`;
|
|
40
|
-
return yield* (0,
|
|
42
|
+
return yield* (0, internal_1.createAsyncIterable)(({ next }) => {
|
|
41
43
|
const server = new dev_server_1.RspackDevServer({
|
|
42
44
|
...devServerConfig,
|
|
43
45
|
onListening: () => {
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
"description": "Run @rspack/dev-server to serve a project.",
|
|
6
6
|
"continuous": true,
|
|
7
7
|
"type": "object",
|
|
8
|
+
"x-deprecated": "The `@nx/rspack:dev-server` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/rspack:convert-to-inferred` to migrate to the `@nx/rspack/plugin` inferred plugin. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.",
|
|
8
9
|
"properties": {
|
|
9
10
|
"buildTarget": {
|
|
10
11
|
"type": "string",
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.default = moduleFederationDevServer;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
6
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
7
|
+
const internal_2 = require("@nx/js/internal");
|
|
8
8
|
const utils_1 = require("@nx/module-federation/src/executors/utils");
|
|
9
9
|
const file_server_impl_1 = tslib_1.__importDefault(require("@nx/web/src/executors/file-server/file-server.impl"));
|
|
10
10
|
const wait_for_port_open_1 = require("@nx/web/src/utils/wait-for-port-open");
|
|
@@ -25,7 +25,7 @@ async function* moduleFederationDevServer(schema, context) {
|
|
|
25
25
|
}, context)
|
|
26
26
|
: (0, dev_server_impl_1.default)(options, context);
|
|
27
27
|
const p = context.projectsConfigurations.projects[context.projectName];
|
|
28
|
-
let pathToManifestFile = (0, path_1.join)(context.root, (0,
|
|
28
|
+
let pathToManifestFile = (0, path_1.join)(context.root, (0, internal_2.getProjectSourceRoot)(p), 'assets/module-federation.manifest.json');
|
|
29
29
|
if (options.pathToManifestFile) {
|
|
30
30
|
const userPathToManifestFile = (0, path_1.join)(context.root, options.pathToManifestFile);
|
|
31
31
|
if (!(0, fs_1.existsSync)(userPathToManifestFile)) {
|
|
@@ -40,7 +40,7 @@ async function* moduleFederationDevServer(schema, context) {
|
|
|
40
40
|
return yield* currIter;
|
|
41
41
|
}
|
|
42
42
|
const { staticRemotesIter, devRemoteIters, remotes } = await (0, utils_1.startRemoteIterators)(options, context, lib_1.startRemotes, pathToManifestFile, 'react');
|
|
43
|
-
return yield* (0,
|
|
43
|
+
return yield* (0, internal_1.combineAsyncIterables)(currIter, ...devRemoteIters, ...(staticRemotesIter ? [staticRemotesIter] : []), (0, internal_1.createAsyncIterable)(async ({ next, done }) => {
|
|
44
44
|
if (!options.isInitialHost) {
|
|
45
45
|
done();
|
|
46
46
|
return;
|
package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js
CHANGED
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.default = moduleFederationSsrDevServer;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
6
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
7
|
+
const internal_2 = require("@nx/js/internal");
|
|
8
8
|
const utils_1 = require("@nx/module-federation/src/executors/utils");
|
|
9
9
|
const wait_for_port_open_1 = require("@nx/web/src/utils/wait-for-port-open");
|
|
10
10
|
const fs_1 = require("fs");
|
|
@@ -15,7 +15,7 @@ async function* moduleFederationSsrDevServer(ssrDevServerOptions, context) {
|
|
|
15
15
|
const options = (0, lib_1.normalizeOptions)(ssrDevServerOptions);
|
|
16
16
|
const iter = (0, ssr_dev_server_impl_1.default)(options, context);
|
|
17
17
|
const projectConfig = context.projectsConfigurations.projects[context.projectName];
|
|
18
|
-
let pathToManifestFile = (0, path_1.join)(context.root, (0,
|
|
18
|
+
let pathToManifestFile = (0, path_1.join)(context.root, (0, internal_2.getProjectSourceRoot)(projectConfig), 'assets/module-federation.manifest.json');
|
|
19
19
|
if (options.pathToManifestFile) {
|
|
20
20
|
const userPathToManifestFile = (0, path_1.join)(context.root, options.pathToManifestFile);
|
|
21
21
|
if (!(0, fs_1.existsSync)(userPathToManifestFile)) {
|
|
@@ -30,7 +30,7 @@ async function* moduleFederationSsrDevServer(ssrDevServerOptions, context) {
|
|
|
30
30
|
return yield* iter;
|
|
31
31
|
}
|
|
32
32
|
const { staticRemotesIter, devRemoteIters, remotes } = await (0, utils_1.startRemoteIterators)(options, context, lib_1.startRemotes, pathToManifestFile, 'react', true);
|
|
33
|
-
return yield* (0,
|
|
33
|
+
return yield* (0, internal_1.combineAsyncIterables)(iter, ...devRemoteIters, ...(staticRemotesIter ? [staticRemotesIter] : []), (0, internal_1.createAsyncIterable)(async ({ next, done }) => {
|
|
34
34
|
if (!options.isInitialHost) {
|
|
35
35
|
done();
|
|
36
36
|
return;
|
package/src/executors/module-federation-static-server/module-federation-static-server.impl.js
CHANGED
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.startProxies = startProxies;
|
|
4
4
|
exports.default = moduleFederationStaticServer;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
7
|
const devkit_1 = require("@nx/devkit");
|
|
7
|
-
const
|
|
8
|
-
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
8
|
+
const internal_2 = require("@nx/js/internal");
|
|
9
9
|
const utils_1 = require("@nx/module-federation/src/executors/utils");
|
|
10
10
|
const utils_2 = require("@nx/module-federation/src/utils");
|
|
11
11
|
const file_server_impl_1 = tslib_1.__importDefault(require("@nx/web/src/executors/file-server/file-server.impl"));
|
|
@@ -18,7 +18,7 @@ function getBuildAndServeOptionsFromServeTarget(serveTarget, context) {
|
|
|
18
18
|
const serveOptions = (0, devkit_1.readTargetOptions)(target, context);
|
|
19
19
|
const buildTarget = (0, devkit_1.parseTargetString)(serveOptions.buildTarget, context);
|
|
20
20
|
const buildOptions = (0, devkit_1.readTargetOptions)(buildTarget, context);
|
|
21
|
-
let pathToManifestFile = (0, path_1.join)(context.root, (0,
|
|
21
|
+
let pathToManifestFile = (0, path_1.join)(context.root, (0, internal_2.getProjectSourceRoot)(context.projectGraph.nodes[context.projectName].data), 'assets/module-federation.manifest.json');
|
|
22
22
|
if (serveOptions.pathToManifestFile) {
|
|
23
23
|
const userPathToManifestFile = (0, path_1.join)(context.root, serveOptions.pathToManifestFile);
|
|
24
24
|
if (!(0, fs_1.existsSync)(userPathToManifestFile)) {
|
|
@@ -201,7 +201,7 @@ async function* moduleFederationStaticServer(schema, context) {
|
|
|
201
201
|
pathToKey: (0, path_1.join)(devkit_1.workspaceRoot, options.serveOptions.sslKey),
|
|
202
202
|
}
|
|
203
203
|
: undefined);
|
|
204
|
-
return yield* (0,
|
|
204
|
+
return yield* (0, internal_1.combineAsyncIterables)(staticFileServerIter, (0, internal_1.createAsyncIterable)(async ({ next, done }) => {
|
|
205
205
|
const host = options.serveOptions.host ?? 'localhost';
|
|
206
206
|
const baseUrl = `http${options.serveOptions.ssl ? 's' : ''}://${host}:${options.serveOptions.port}`;
|
|
207
207
|
if (remotes.remotePorts.length === 0) {
|
|
@@ -4,11 +4,11 @@ exports.normalizeOptions = normalizeOptions;
|
|
|
4
4
|
exports.normalizePluginPath = normalizePluginPath;
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
const normalize_options_1 = require("../../../plugins/utils/plugins/normalize-options");
|
|
7
|
-
const
|
|
7
|
+
const internal_1 = require("@nx/js/internal");
|
|
8
8
|
function normalizeOptions(options, root, projectRoot, sourceRoot) {
|
|
9
9
|
const normalizedOptions = {
|
|
10
10
|
...options,
|
|
11
|
-
useTsconfigPaths: !(0,
|
|
11
|
+
useTsconfigPaths: !(0, internal_1.isUsingTsSolutionSetup)(),
|
|
12
12
|
root,
|
|
13
13
|
projectRoot,
|
|
14
14
|
sourceRoot,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rspack.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/executors/rspack/rspack.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAU,MAAM,YAAY,CAAC;AAiBrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"rspack.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/executors/rspack/rspack.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAU,MAAM,YAAY,CAAC;AAiBrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAGhD,wBAA+B,WAAW,CACxC,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,eAAe;aA4Bb,OAAO;cACN,MAAM;cA+EnB"}
|
|
@@ -2,19 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = runExecutor;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
6
|
const js_1 = require("@nx/js");
|
|
7
|
-
const
|
|
7
|
+
const internal_2 = require("@nx/js/internal");
|
|
8
8
|
const core_1 = require("@rspack/core");
|
|
9
9
|
const path_1 = require("path");
|
|
10
10
|
const create_compiler_1 = require("../../utils/create-compiler");
|
|
11
11
|
const mode_utils_1 = require("../../utils/mode-utils");
|
|
12
12
|
const normalize_options_1 = require("./lib/normalize-options");
|
|
13
|
+
const deprecation_1 = require("../../utils/deprecation");
|
|
13
14
|
async function* runExecutor(options, context) {
|
|
15
|
+
(0, deprecation_1.warnRspackExecutorDeprecation)();
|
|
14
16
|
process.env.NODE_ENV ??= options.mode ?? 'production';
|
|
15
17
|
options.target ??= 'web';
|
|
16
18
|
const metadata = context.projectsConfigurations.projects[context.projectName];
|
|
17
|
-
const sourceRoot = (0,
|
|
19
|
+
const sourceRoot = (0, internal_2.getProjectSourceRoot)(metadata);
|
|
18
20
|
const normalizedOptions = (0, normalize_options_1.normalizeOptions)(options, context.root, metadata.root, sourceRoot);
|
|
19
21
|
if ((0, mode_utils_1.isMode)(process.env.NODE_ENV)) {
|
|
20
22
|
normalizedOptions.mode = process.env.NODE_ENV;
|
|
@@ -23,7 +25,7 @@ async function* runExecutor(options, context) {
|
|
|
23
25
|
await executeTypeCheck(normalizedOptions, context);
|
|
24
26
|
}
|
|
25
27
|
const compiler = await (0, create_compiler_1.createCompiler)(normalizedOptions, context);
|
|
26
|
-
const iterable = (0,
|
|
28
|
+
const iterable = (0, internal_1.createAsyncIterable)(async ({ next, done }) => {
|
|
27
29
|
const watch = (compiler instanceof core_1.Compiler
|
|
28
30
|
? compiler.options.watch
|
|
29
31
|
: compiler.options[0].watch) ?? options.watch;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
"title": "Rspack build executor",
|
|
5
5
|
"description": "Run Rspack via an executor for a project.",
|
|
6
6
|
"type": "object",
|
|
7
|
+
"x-deprecated": "The `@nx/rspack:rspack` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/rspack:convert-to-inferred` to migrate to the `@nx/rspack/plugin` inferred plugin. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.",
|
|
7
8
|
"properties": {
|
|
8
9
|
"target": {
|
|
9
10
|
"type": "string",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr-dev-server.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/executors/ssr-dev-server/ssr-dev-server.impl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ssr-dev-server.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/executors/ssr-dev-server/ssr-dev-server.impl.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EAIhB,MAAM,YAAY,CAAC;AAKpB,OAAO,EAAE,yBAAyB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEpE,wBAAuB,oBAAoB,CACzC,OAAO,EAAE,yBAAyB,EAClC,OAAO,EAAE,eAAe;;aA0Bb,OAAO;aAEP,aAAa;kBA6BzB;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ssrDevServerExecutor = ssrDevServerExecutor;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
6
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const async_iterable_1 = require("@nx/devkit/src/utils/async-iterable");
|
|
7
7
|
const pc = tslib_1.__importStar(require("picocolors"));
|
|
8
8
|
const wait_until_server_is_listening_1 = require("./lib/wait-until-server-is-listening");
|
|
9
9
|
async function* ssrDevServerExecutor(options, context) {
|
|
@@ -15,7 +15,7 @@ async function* ssrDevServerExecutor(options, context) {
|
|
|
15
15
|
const runServer = await (0, devkit_1.runExecutor)(serverTarget, { ...serverOptions, ...options.serverTargetOptions }, context);
|
|
16
16
|
let browserBuilt = false;
|
|
17
17
|
let nodeStarted = false;
|
|
18
|
-
const combined = (0,
|
|
18
|
+
const combined = (0, internal_1.combineAsyncIterables)(runBrowser, runServer);
|
|
19
19
|
for await (const output of combined) {
|
|
20
20
|
if (!output.success)
|
|
21
21
|
throw new Error('Could not build application');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/generators/configuration/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,IAAI,EAGL,MAAM,YAAY,CAAC;AAepB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/generators/configuration/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,IAAI,EAGL,MAAM,YAAY,CAAC;AAepB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAoD/C,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,mBAAmB,mDAqI7B;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -6,19 +6,14 @@ const devkit_1 = require("@nx/devkit");
|
|
|
6
6
|
const path_1 = require("path");
|
|
7
7
|
const generator_utils_1 = require("../../utils/generator-utils");
|
|
8
8
|
const init_1 = tslib_1.__importDefault(require("../init/init"));
|
|
9
|
-
const
|
|
9
|
+
const internal_1 = require("@nx/js/internal");
|
|
10
|
+
const deprecation_1 = require("../../utils/deprecation");
|
|
11
|
+
const assert_supported_rspack_version_1 = require("../../utils/assert-supported-rspack-version");
|
|
10
12
|
function projectIsRootProjectInStandaloneWorkspace(projectRoot) {
|
|
11
13
|
return (0, path_1.relative)(devkit_1.workspaceRoot, projectRoot).length === 0;
|
|
12
14
|
}
|
|
13
15
|
function editTsConfig(tree, projectRoot, framework, relativePathToRootTsConfig) {
|
|
14
|
-
|
|
15
|
-
let shared;
|
|
16
|
-
try {
|
|
17
|
-
shared = require('@nx/js/src/utils/typescript/create-ts-config');
|
|
18
|
-
}
|
|
19
|
-
catch {
|
|
20
|
-
shared = require('@nx/workspace/src/utils/create-ts-config');
|
|
21
|
-
}
|
|
16
|
+
const shared = require('@nx/js');
|
|
22
17
|
if (framework === 'react') {
|
|
23
18
|
const json = {
|
|
24
19
|
compilerOptions: {
|
|
@@ -52,6 +47,7 @@ function editTsConfig(tree, projectRoot, framework, relativePathToRootTsConfig)
|
|
|
52
47
|
}
|
|
53
48
|
}
|
|
54
49
|
async function configurationGenerator(tree, options) {
|
|
50
|
+
(0, assert_supported_rspack_version_1.assertSupportedRspackVersion)(tree);
|
|
55
51
|
const task = await (0, init_1.default)(tree, {
|
|
56
52
|
...options,
|
|
57
53
|
});
|
|
@@ -76,7 +72,7 @@ async function configurationGenerator(tree, options) {
|
|
|
76
72
|
projectAlreadyHasRspackTargets = alreadyHasNxRspackTargets;
|
|
77
73
|
if (alreadyHasNxRspackTargets.build &&
|
|
78
74
|
(alreadyHasNxRspackTargets.serve ||
|
|
79
|
-
(0,
|
|
75
|
+
(0, internal_1.getProjectType)(tree, options.project, projectType) === 'library' ||
|
|
80
76
|
options.framework === 'nest')) {
|
|
81
77
|
throw new Error(`The project ${options.project} is already configured to use the @nx/rspack executors.
|
|
82
78
|
Please try a different project, or remove the existing targets
|
|
@@ -106,6 +102,13 @@ async function configurationGenerator(tree, options) {
|
|
|
106
102
|
(0, generator_utils_1.deleteWebpackConfig)(tree, root, targets?.[buildTargetName]?.options?.webpackConfig);
|
|
107
103
|
editTsConfig(tree, root, options.framework, (0, devkit_1.joinPathFragments)((0, devkit_1.offsetFromRoot)(root), 'tsconfig.base.json'));
|
|
108
104
|
}
|
|
105
|
+
const willScaffoldExecutorTargets = !projectAlreadyHasRspackTargets.build ||
|
|
106
|
+
((options.framework !== 'none' || options.devServer) &&
|
|
107
|
+
options.framework !== 'nest' &&
|
|
108
|
+
!projectAlreadyHasRspackTargets.serve);
|
|
109
|
+
if (willScaffoldExecutorTargets) {
|
|
110
|
+
(0, deprecation_1.warnRspackExecutorGenerating)();
|
|
111
|
+
}
|
|
109
112
|
if (!projectAlreadyHasRspackTargets.build) {
|
|
110
113
|
(0, generator_utils_1.addOrChangeBuildTarget)(tree, options, buildTargetName);
|
|
111
114
|
}
|
package/src/generators/convert-config-to-rspack-plugin/convert-config-to-rspack-plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-config-to-rspack-plugin.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/generators/convert-config-to-rspack-plugin/convert-config-to-rspack-plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"convert-config-to-rspack-plugin.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/generators/convert-config-to-rspack-plugin/convert-config-to-rspack-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,IAAI,EAIL,MAAM,YAAY,CAAC;AAQpB,UAAU,MAAM;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAWD,wBAAsB,oCAAoC,CACxD,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,MAAM,iBAsGhB;AAED,eAAe,oCAAoC,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.convertConfigToRspackPluginGenerator = convertConfigToRspackPluginGenerator;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const executor_options_utils_1 = require("@nx/devkit/src/generators/executor-options-utils");
|
|
6
6
|
const extract_rspack_options_1 = require("./lib/extract-rspack-options");
|
|
7
7
|
const normalize_path_options_1 = require("./lib/normalize-path-options");
|
|
8
8
|
const path_1 = require("path");
|
|
9
9
|
const validate_project_1 = require("./lib/validate-project");
|
|
10
|
+
const assert_supported_rspack_version_1 = require("../../utils/assert-supported-rspack-version");
|
|
10
11
|
// Make text JSON compatible
|
|
11
12
|
const preprocessText = (text) => {
|
|
12
13
|
return text
|
|
@@ -16,9 +17,10 @@ const preprocessText = (text) => {
|
|
|
16
17
|
.replace(/(\r\n|\n|\r|\t)/gm, ''); // Remove newlines and tabs
|
|
17
18
|
};
|
|
18
19
|
async function convertConfigToRspackPluginGenerator(tree, options) {
|
|
20
|
+
(0, assert_supported_rspack_version_1.assertSupportedRspackVersion)(tree);
|
|
19
21
|
let migrated = 0;
|
|
20
22
|
const projects = (0, devkit_1.getProjects)(tree);
|
|
21
|
-
(0,
|
|
23
|
+
(0, internal_1.forEachExecutorOptions)(tree, '@nx/rspack:rspack', (currentTargetOptions, projectName, targetName, configurationName) => {
|
|
22
24
|
if (options.project && projectName !== options.project) {
|
|
23
25
|
return;
|
|
24
26
|
}
|
|
@@ -63,11 +65,7 @@ async function convertConfigToRspackPluginGenerator(tree, options) {
|
|
|
63
65
|
: 'new NxAppRspackPlugin()'},
|
|
64
66
|
${withReactConfig
|
|
65
67
|
? `new NxReactRspackPlugin(${withReactConfig.getText()})`
|
|
66
|
-
: `new NxReactRspackPlugin(
|
|
67
|
-
// Uncomment this line if you don't want to use SVGR
|
|
68
|
-
// See: https://react-svgr.com/
|
|
69
|
-
// svgr: false
|
|
70
|
-
})`},
|
|
68
|
+
: `new NxReactRspackPlugin()`},
|
|
71
69
|
// NOTE: useLegacyNxPlugin ensures that the non-standard Rspack configuration file previously used still works.
|
|
72
70
|
// To remove its usage, move options such as "plugins" into this file as standard Rspack configuration options.
|
|
73
71
|
// To enhance configurations after Nx plugins have applied, you can add a new plugin with the \`apply\` method.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-to-inferred.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/generators/convert-to-inferred/convert-to-inferred.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"convert-to-inferred.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/generators/convert-to-inferred/convert-to-inferred.ts"],"names":[],"mappings":"AAKA,OAAO,EAML,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAUpB,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAG/D,UAAU,MAAM;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,mDAiFlE;AA6CD,wBAAgB,sBAAsB,IAAI,OAAO,YAAY,GAAG;IAC9D,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACtC,SAAS,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,KAAK,IAAI,CAAC;CAC5D,CAkCA"}
|
|
@@ -2,23 +2,24 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.convertToInferred = convertToInferred;
|
|
4
4
|
exports.createCollectingLogger = createCollectingLogger;
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
6
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const aggregate_log_util_1 = require("@nx/devkit/src/generators/plugin-migrations/aggregate-log-util");
|
|
7
|
-
const executor_to_plugin_migrator_1 = require("@nx/devkit/src/generators/plugin-migrations/executor-to-plugin-migrator");
|
|
8
7
|
const tsquery_1 = require("@phenomnomnominal/tsquery");
|
|
9
8
|
const plugin_1 = require("../../plugins/plugin");
|
|
10
9
|
const versions_1 = require("../../utils/versions");
|
|
11
10
|
const utils_1 = require("./utils");
|
|
12
11
|
const devkit_exports_1 = require("nx/src/devkit-exports");
|
|
12
|
+
const assert_supported_rspack_version_1 = require("../../utils/assert-supported-rspack-version");
|
|
13
13
|
async function convertToInferred(tree, options) {
|
|
14
|
+
(0, assert_supported_rspack_version_1.assertSupportedRspackVersion)(tree);
|
|
14
15
|
const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
|
|
15
16
|
const migrationContext = {
|
|
16
|
-
logger: new
|
|
17
|
+
logger: new internal_1.AggregatedLog(),
|
|
17
18
|
projectGraph,
|
|
18
19
|
workspaceRoot: tree.root,
|
|
19
20
|
};
|
|
20
21
|
const logger = createCollectingLogger();
|
|
21
|
-
const migratedProjects = await (0,
|
|
22
|
+
const migratedProjects = await (0, internal_1.migrateProjectExecutorsToPlugin)(tree, projectGraph, '@nx/rspack/plugin', plugin_1.createNodesV2, {
|
|
22
23
|
buildTargetName: 'build',
|
|
23
24
|
previewTargetName: 'preview',
|
|
24
25
|
serveStaticTargetName: 'serve-static',
|
|
@@ -47,13 +48,19 @@ async function convertToInferred(tree, options) {
|
|
|
47
48
|
}
|
|
48
49
|
else {
|
|
49
50
|
logger.flushLogs();
|
|
50
|
-
throw new
|
|
51
|
+
throw new internal_1.NoTargetsToMigrateError();
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
54
|
else {
|
|
54
55
|
logger.flushLogs();
|
|
55
56
|
}
|
|
56
|
-
const installCallback = (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
57
|
+
const installCallback = (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
58
|
+
'@rspack/core': versions_1.rspackCoreVersion,
|
|
59
|
+
// The inferred plugin's targets run the `rspack` CLI. Since
|
|
60
|
+
// @rspack/cli is an optional peer dependency of @nx/rspack, install
|
|
61
|
+
// it explicitly so the converted targets can execute.
|
|
62
|
+
'@rspack/cli': versions_1.rspackCoreVersion,
|
|
63
|
+
}, undefined, true);
|
|
57
64
|
if (!options.skipFormat) {
|
|
58
65
|
await (0, devkit_1.formatFiles)(tree);
|
|
59
66
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildPostTargetTransformerFactory = buildPostTargetTransformerFactory;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
6
|
const tsquery_1 = require("@phenomnomnominal/tsquery");
|
|
7
7
|
const ts = tslib_1.__importStar(require("typescript"));
|
|
8
8
|
const ast_1 = require("./ast");
|
|
@@ -16,7 +16,7 @@ function buildPostTargetTransformerFactory(migrationContext) {
|
|
|
16
16
|
const { pluginOptions, rspackConfigPath } = processOptions(target, context);
|
|
17
17
|
updateRspackConfig(tree, rspackConfigPath, pluginOptions);
|
|
18
18
|
if (target.outputs) {
|
|
19
|
-
(0,
|
|
19
|
+
(0, internal_1.processTargetOutputs)(target, [], inferredTarget, {
|
|
20
20
|
projectName: projectDetails.projectName,
|
|
21
21
|
projectRoot: projectDetails.root,
|
|
22
22
|
});
|
|
@@ -50,29 +50,29 @@ function extractPluginOptions(options, context, configName) {
|
|
|
50
50
|
const pluginOptions = {};
|
|
51
51
|
for (const [key, value] of Object.entries(options)) {
|
|
52
52
|
if (pathOptions.has(key)) {
|
|
53
|
-
pluginOptions[key] = (0,
|
|
53
|
+
pluginOptions[key] = (0, internal_1.toProjectRelativePath)(value, context.projectRoot);
|
|
54
54
|
delete options[key];
|
|
55
55
|
}
|
|
56
56
|
else if (assetsOptions.has(key)) {
|
|
57
57
|
pluginOptions[key] = value.map((asset) => {
|
|
58
58
|
if (typeof asset === 'string') {
|
|
59
|
-
return (0,
|
|
59
|
+
return (0, internal_1.toProjectRelativePath)(asset, context.projectRoot);
|
|
60
60
|
}
|
|
61
|
-
asset.input = (0,
|
|
61
|
+
asset.input = (0, internal_1.toProjectRelativePath)(asset.input, context.projectRoot);
|
|
62
62
|
return asset;
|
|
63
63
|
});
|
|
64
64
|
delete options[key];
|
|
65
65
|
}
|
|
66
66
|
else if (key === 'fileReplacements') {
|
|
67
67
|
pluginOptions.fileReplacements = value.map((replacement) => ({
|
|
68
|
-
replace: (0,
|
|
69
|
-
with: (0,
|
|
68
|
+
replace: (0, internal_1.toProjectRelativePath)(replacement.replace, context.projectRoot),
|
|
69
|
+
with: (0, internal_1.toProjectRelativePath)(replacement.with, context.projectRoot),
|
|
70
70
|
}));
|
|
71
71
|
delete options.fileReplacements;
|
|
72
72
|
}
|
|
73
73
|
else if (key === 'additionalEntryPoints') {
|
|
74
74
|
pluginOptions.additionalEntryPoints = value.map((entryPoint) => {
|
|
75
|
-
entryPoint.entryPath = (0,
|
|
75
|
+
entryPoint.entryPath = (0, internal_1.toProjectRelativePath)(entryPoint.entryPath, context.projectRoot);
|
|
76
76
|
return entryPoint;
|
|
77
77
|
});
|
|
78
78
|
delete options.additionalEntryPoints;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve-post-target-transformer.d.ts","sourceRoot":"","sources":["../../../../../../../packages/rspack/src/generators/convert-to-inferred/utils/serve-post-target-transformer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"serve-post-target-transformer.d.ts","sourceRoot":"","sources":["../../../../../../../packages/rspack/src/generators/convert-to-inferred/utils/serve-post-target-transformer.ts"],"names":[],"mappings":"AAIA,OAAO,EAML,KAAK,mBAAmB,EACxB,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAQpB,OAAO,KAAK,EAAE,gBAAgB,EAAsB,MAAM,SAAS,CAAC;AAEpE,wBAAgB,iCAAiC,CAC/C,gBAAgB,EAAE,gBAAgB,IAGhC,QAAQ,mBAAmB,EAC3B,MAAM,IAAI,EACV,gBAAgB;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EACrD,gBAAgB,mBAAmB,KAClC,OAAO,CAAC,mBAAmB,CAAC,CAwBhC"}
|