@nx/rspack 24.0.2 → 24.0.4

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.
@@ -100,6 +100,14 @@ function extractPluginOptions(options, context, configName) {
100
100
  else if (key === 'standardRspackConfigFunction') {
101
101
  delete options.standardRspackConfigFunction;
102
102
  }
103
+ else if (key === 'transformers') {
104
+ context.logger.addLog({
105
+ executorName: '@nx/rspack:rspack',
106
+ log: `The "transformers" option was removed because Rspack compiles TypeScript with "builtin:swc-loader", which cannot run TypeScript transformer plugins. It never had an effect on the build.`,
107
+ project: context.projectName,
108
+ });
109
+ delete options.transformers;
110
+ }
103
111
  else {
104
112
  pluginOptions[key] = value;
105
113
  delete options[key];
@@ -19,6 +19,7 @@ const nodeExternals = require("webpack-node-externals");
19
19
  const internal_1 = require("@nx/js/internal");
20
20
  const get_non_buildable_libs_1 = require("./get-non-buildable-libs");
21
21
  const is_serve_mode_1 = require("../../utils/is-serve-mode");
22
+ const warn_unsupported_transformers_1 = require("./warn-unsupported-transformers");
22
23
  const IGNORED_RSPACK_WARNINGS = [
23
24
  /The comment file/i,
24
25
  /could not find any license/i,
@@ -32,6 +33,7 @@ const extensionAlias = {
32
33
  };
33
34
  const mainFields = ['module', 'main'];
34
35
  function applyBaseConfig(options, config = {}, { useNormalizedEntry, compiler, } = {}) {
36
+ const hasTransformers = !!options.transformers?.length;
35
37
  // Defaults that was applied from executor schema previously.
36
38
  options.externalDependencies ??= 'all';
37
39
  options.fileReplacements ??= [];
@@ -46,6 +48,7 @@ function applyBaseConfig(options, config = {}, { useNormalizedEntry, compiler, }
46
48
  // Some of the options only work during actual tasks, not when reading the rspack config during CreateNodes.
47
49
  if (global.NX_GRAPH_CREATION)
48
50
  return;
51
+ (0, warn_unsupported_transformers_1.warnUnsupportedTransformers)(hasTransformers, options.projectRoot);
49
52
  applyNxDependentConfig(options, config, { useNormalizedEntry }, rspackCore);
50
53
  }
51
54
  function applyNxIndependentConfig(options, config, rspackCore) {
@@ -0,0 +1,2 @@
1
+ export declare const RSPACK_TRANSFORMERS_UNSUPPORTED_MESSAGE = "The `transformers` option is not supported by `@nx/rspack` and has no effect, because `builtin:swc-loader` cannot run TypeScript transformer plugins. Remove it, or use `@nx/webpack` with `compiler: 'tsc'` for projects that need one, such as the `@nestjs/swagger` CLI plugin.";
2
+ export declare function warnUnsupportedTransformers(hasTransformers: boolean, projectRoot: string): void;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RSPACK_TRANSFORMERS_UNSUPPORTED_MESSAGE = void 0;
4
+ exports.warnUnsupportedTransformers = warnUnsupportedTransformers;
5
+ const devkit_1 = require("@nx/devkit");
6
+ // Webpack gives this option to ts-loader's getCustomTransformers; rspack
7
+ // compiles TypeScript with `builtin:swc-loader`, which cannot run TypeScript
8
+ // transformer plugins.
9
+ exports.RSPACK_TRANSFORMERS_UNSUPPORTED_MESSAGE = "The `transformers` option is not supported by `@nx/rspack` and has no effect, because `builtin:swc-loader` cannot run TypeScript transformer plugins. Remove it, or use `@nx/webpack` with `compiler: 'tsc'` for projects that need one, such as the `@nestjs/swagger` CLI plugin.";
10
+ const warnedProjects = new Set();
11
+ // Keyed per project so a `run-many` still reports every affected project, while
12
+ // watch rebuilds of one project log a single line.
13
+ function warnUnsupportedTransformers(hasTransformers, projectRoot) {
14
+ if (!hasTransformers || warnedProjects.has(projectRoot))
15
+ return;
16
+ warnedProjects.add(projectRoot);
17
+ devkit_1.logger.warn(exports.RSPACK_TRANSFORMERS_UNSUPPORTED_MESSAGE);
18
+ }
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.2",
4
+ "version": "24.0.4",
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.2",
163
- "@nx/js": "24.0.2",
164
- "@nx/web": "24.0.2",
162
+ "@nx/devkit": "24.0.4",
163
+ "@nx/js": "24.0.4",
164
+ "@nx/web": "24.0.4",
165
165
  "@phenomnomnominal/tsquery": "~6.2.0",
166
166
  "autoprefixer": "^10.4.9",
167
167
  "browserslist": "^4.26.0",
@@ -186,8 +186,8 @@
186
186
  "webpack-node-externals": "^3.0.0"
187
187
  },
188
188
  "devDependencies": {
189
- "nx": "24.0.2",
190
- "@nx/nest": "24.0.2",
189
+ "nx": "24.0.4",
190
+ "@nx/nest": "24.0.4",
191
191
  "@rspack/cli": "^2.0.4"
192
192
  },
193
193
  "peerDependencies": {