@nx/rspack 24.0.6 → 24.1.0-beta.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/dist/module-federation.js +1 -1
- package/dist/src/generators/init/init.js +1 -3
- package/dist/src/plugins/utils/apply-base-config.js +1 -1
- package/dist/src/plugins/utils/apply-web-config.js +2 -13
- package/dist/src/utils/config.js +1 -1
- package/dist/src/utils/deprecation.js +1 -1
- package/dist/src/utils/with-nx.js +1 -1
- package/dist/src/utils/with-react.js +1 -1
- package/dist/src/utils/with-web.js +1 -1
- package/package.json +6 -7
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.withModuleFederation = withModuleFederation;
|
|
4
4
|
exports.withModuleFederationForSSR = withModuleFederationForSSR;
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
// TODO(v25): Delete this subpath. It keeps 23.x configs loading during graph creation so `nx migrate` can run.
|
|
6
|
+
// TODO(v25): Delete this subpath (NXC-5165). It keeps 23.x configs loading during graph creation so `nx migrate` can run.
|
|
7
7
|
const REMOVED_MESSAGE = 'Nx Module Federation was removed in Nx v24. `@nx/rspack/module-federation` is a stub that keeps old configs loadable during project graph creation; it does not configure Module Federation. Follow https://nx.dev/docs/kb/migrate-from-nx-module-federation to move to the official Module Federation plugin.';
|
|
8
8
|
let warned = false;
|
|
9
9
|
// Graph creation only reads the config, so it keeps working; a build would silently drop federation.
|
|
@@ -84,9 +84,7 @@ async function rspackInitGenerator(tree, schema) {
|
|
|
84
84
|
devDependencies['@rspack/dev-server'] =
|
|
85
85
|
rspackVersions.rspackDevServerVersion;
|
|
86
86
|
}
|
|
87
|
-
// @
|
|
88
|
-
// script only builds from source when npm_config_build_from_source is set,
|
|
89
|
-
// so skip it.
|
|
87
|
+
// @parcel/watcher's install script is only needed for opt-in source builds.
|
|
90
88
|
(0, internal_1.acknowledgeBuildScripts)(tree, (0, devkit_1.detectPackageManager)(tree.root), {
|
|
91
89
|
'@parcel/watcher': false,
|
|
92
90
|
});
|
|
@@ -143,7 +143,7 @@ function applyNxIndependentConfig(options, config, rspackCore) {
|
|
|
143
143
|
config.watchOptions = {
|
|
144
144
|
poll: options.poll,
|
|
145
145
|
};
|
|
146
|
-
// TODO(
|
|
146
|
+
// TODO(v25): drop once @rspack/core v1 is out of the support window (NXC-5161).
|
|
147
147
|
// v2 removed top-level `profile`; Rsdoctor replaces it.
|
|
148
148
|
if (options.statsJson && installedRspackMajor < 2) {
|
|
149
149
|
config.profile = true;
|
|
@@ -74,9 +74,8 @@ function applyWebConfig(options, config = {}, { useNormalizedEntry, compiler, }
|
|
|
74
74
|
}));
|
|
75
75
|
}
|
|
76
76
|
if (!options.ssr) {
|
|
77
|
-
plugins.push(new DefinePlugin(getClientEnvironment(
|
|
77
|
+
plugins.push(new DefinePlugin(getClientEnvironment().stringified));
|
|
78
78
|
}
|
|
79
|
-
const entries = {};
|
|
80
79
|
const globalStylePaths = [];
|
|
81
80
|
// Determine hashing format.
|
|
82
81
|
const hashFormat = (0, hash_format_1.getOutputHashFormat)(options.outputHashing);
|
|
@@ -267,14 +266,6 @@ function applyWebConfig(options, config = {}, { useNormalizedEntry, compiler, }
|
|
|
267
266
|
throw new Error('Entry string is not supported. Use an object.');
|
|
268
267
|
if (Array.isArray(config.entry))
|
|
269
268
|
throw new Error('Entry array is not supported. Use an object.');
|
|
270
|
-
Object.entries(entries).forEach(([entryName, entryData]) => {
|
|
271
|
-
if (useNormalizedEntry) {
|
|
272
|
-
config.entry[entryName] = { import: entryData.import };
|
|
273
|
-
}
|
|
274
|
-
else {
|
|
275
|
-
config.entry[entryName] = entryData.import;
|
|
276
|
-
}
|
|
277
|
-
});
|
|
278
269
|
config.optimization = !isProd
|
|
279
270
|
? (config.optimization ?? {})
|
|
280
271
|
: {
|
|
@@ -337,9 +328,7 @@ function applyWebConfig(options, config = {}, { useNormalizedEntry, compiler, }
|
|
|
337
328
|
config.plugins ??= [];
|
|
338
329
|
config.plugins.push(...plugins);
|
|
339
330
|
}
|
|
340
|
-
function getClientEnvironment(
|
|
341
|
-
// Grab NODE_ENV and NX_PUBLIC_* environment variables and prepare them to be
|
|
342
|
-
// injected into the application via DefinePlugin in rspack configuration.
|
|
331
|
+
function getClientEnvironment() {
|
|
343
332
|
const nxPublicKeyRegex = /^NX_PUBLIC_/i;
|
|
344
333
|
const raw = Object.keys(process.env)
|
|
345
334
|
.filter((key) => nxPublicKeyRegex.test(key))
|
package/dist/src/utils/config.js
CHANGED
|
@@ -9,7 +9,7 @@ exports.nxRspackComposablePlugin = 'nxRspackComposablePlugin';
|
|
|
9
9
|
function isNxRspackComposablePlugin(a) {
|
|
10
10
|
return a?.[exports.nxRspackComposablePlugin] === true;
|
|
11
11
|
}
|
|
12
|
-
// TODO(v25): remove the inert config-helper stubs in this file.
|
|
12
|
+
// TODO(v25): remove the inert config-helper stubs in this file (NXC-5164).
|
|
13
13
|
/**
|
|
14
14
|
* @deprecated Use `NxAppRspackPlugin` from `@nx/rspack/app-plugin` (or `NxReactRspackPlugin`
|
|
15
15
|
* from `@nx/rspack/react-plugin`).
|
|
@@ -30,7 +30,7 @@ function warnRspackComposeHelpersDeprecation() {
|
|
|
30
30
|
composeHelpersWarned = true;
|
|
31
31
|
devkit_1.logger.warn(exports.RSPACK_COMPOSE_HELPERS_DEPRECATION_MESSAGE);
|
|
32
32
|
}
|
|
33
|
-
// TODO(v25): remove with the deprecated ssr-dev-server executor
|
|
33
|
+
// TODO(v25): remove with the deprecated ssr-dev-server executor (NXC-5167)
|
|
34
34
|
exports.RSPACK_SSR_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE = 'The `@nx/rspack:ssr-dev-server` executor is deprecated and will be removed in Nx v25. Run the server from source with the `@nx/js/tsx` plugin, with the browser build in watch mode as a continuous dependency. See https://nx.dev/docs/kb/replace-ssr-dev-server.';
|
|
35
35
|
function warnRspackSsrDevServerExecutorDeprecation() {
|
|
36
36
|
devkit_1.logger.warn(exports.RSPACK_SSR_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.withNx = withNx;
|
|
4
4
|
const deprecation_1 = require("./deprecation");
|
|
5
|
-
// TODO(v25): remove the inert config-helper stubs in this file.
|
|
5
|
+
// TODO(v25): remove the inert config-helper stubs in this file (NXC-5164).
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated Use `NxAppRspackPlugin` from `@nx/rspack/app-plugin`.
|
|
8
8
|
* This inert stub will be removed in Nx v25.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.withReact = withReact;
|
|
4
4
|
const deprecation_1 = require("./deprecation");
|
|
5
|
-
// TODO(v25): remove the inert config-helper stubs in this file.
|
|
5
|
+
// TODO(v25): remove the inert config-helper stubs in this file (NXC-5164).
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated Use `NxReactRspackPlugin` from `@nx/rspack/react-plugin`.
|
|
8
8
|
* This inert stub will be removed in Nx v25.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.withWeb = withWeb;
|
|
4
4
|
const deprecation_1 = require("./deprecation");
|
|
5
|
-
// TODO(v25): remove the inert config-helper stubs in this file.
|
|
5
|
+
// TODO(v25): remove the inert config-helper stubs in this file (NXC-5164).
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated Use `NxAppRspackPlugin` from `@nx/rspack/app-plugin`.
|
|
8
8
|
* This inert stub will be removed in Nx v25.
|
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": "24.0.
|
|
4
|
+
"version": "24.1.0-beta.0",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -159,9 +159,9 @@
|
|
|
159
159
|
}
|
|
160
160
|
},
|
|
161
161
|
"dependencies": {
|
|
162
|
-
"@nx/devkit": "24.0.
|
|
163
|
-
"@nx/js": "24.0.
|
|
164
|
-
"@nx/web": "24.0.
|
|
162
|
+
"@nx/devkit": "24.1.0-beta.0",
|
|
163
|
+
"@nx/js": "24.1.0-beta.0",
|
|
164
|
+
"@nx/web": "24.1.0-beta.0",
|
|
165
165
|
"@phenomnomnominal/tsquery": "~6.2.0",
|
|
166
166
|
"autoprefixer": "^10.4.9",
|
|
167
167
|
"browserslist": "^4.26.0",
|
|
@@ -174,7 +174,6 @@
|
|
|
174
174
|
"postcss": "^8.4.38",
|
|
175
175
|
"postcss-import": "~14.1.0",
|
|
176
176
|
"postcss-loader": "^8.1.1",
|
|
177
|
-
"sass": "^1.97.2",
|
|
178
177
|
"sass-embedded": "^1.97.2",
|
|
179
178
|
"sass-loader": "^16.0.7",
|
|
180
179
|
"semver": "^7.6.3",
|
|
@@ -186,8 +185,8 @@
|
|
|
186
185
|
"webpack-node-externals": "^3.0.0"
|
|
187
186
|
},
|
|
188
187
|
"devDependencies": {
|
|
189
|
-
"nx": "24.0.
|
|
190
|
-
"@nx/nest": "24.0.
|
|
188
|
+
"nx": "24.1.0-beta.0",
|
|
189
|
+
"@nx/nest": "24.1.0-beta.0",
|
|
191
190
|
"@rspack/cli": "^2.0.4"
|
|
192
191
|
},
|
|
193
192
|
"peerDependencies": {
|