@nx/rspack 23.0.1 → 23.0.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.
@@ -4,3 +4,4 @@ export default function runExecutor(options: RspackExecutorSchema, context: Exec
4
4
  success: boolean;
5
5
  outfile?: string;
6
6
  }, void, any>;
7
+ export declare function executeTypeCheck(options: RspackExecutorSchema, context: ExecutorContext): Promise<void>;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = runExecutor;
4
+ exports.executeTypeCheck = executeTypeCheck;
4
5
  const devkit_1 = require("@nx/devkit");
5
6
  const internal_1 = require("@nx/devkit/internal");
6
7
  const js_1 = require("@nx/js");
@@ -106,6 +107,10 @@ async function executeTypeCheck(options, context) {
106
107
  workspaceRoot: (0, path_1.resolve)(projectConfiguration.root),
107
108
  tsConfigPath: options.tsConfig,
108
109
  mode: 'noEmit',
110
+ // TS 6 defaults rootDir to the tsconfig dir, so from-source workspace
111
+ // libs (outside the project) trip TS6059. rootDir is emit-only and this
112
+ // is noEmit, so widen it to the workspace root to clear the false error.
113
+ rootDir: context.root,
109
114
  });
110
115
  await (0, js_1.printDiagnostics)(result.errors, result.warnings);
111
116
  if (result.errors.length > 0) {
@@ -256,6 +256,14 @@ function applyNxDependentConfig(options, config, { useNormalizedEntry } = {}) {
256
256
  pluginConfig.typescript.build = true;
257
257
  pluginConfig.typescript.mode = 'readonly';
258
258
  }
259
+ else {
260
+ // TS 6 defaults rootDir to the tsconfig dir, so from-source workspace
261
+ // libs (outside a narrow rootDir) trip TS6059. The checker runs read-only
262
+ // here, so widen rootDir to the workspace root to clear the false error.
263
+ pluginConfig.typescript.configOverwrite = {
264
+ compilerOptions: { rootDir: options.root },
265
+ };
266
+ }
259
267
  plugins.push(new TsCheckerRspackPlugin(pluginConfig));
260
268
  }
261
269
  const entries = [];
@@ -12,13 +12,15 @@ function getOutputHashFormat(option, length = MAX_HASH_LENGTH) {
12
12
  none: { chunk: '', extract: '', file: '', script: '' },
13
13
  media: { chunk: '', extract: '', file: `.[hash:${length}]`, script: '' },
14
14
  bundles: {
15
- chunk: `.[chunkhash:${length}]`,
15
+ // [contenthash] is rspack's recommended hash for caching, matching the entry
16
+ // `filename`; [chunkhash] omits module ids and can serve stale chunks (nx#36014).
17
+ chunk: `.[contenthash:${length}]`,
16
18
  extract: `.[contenthash:${length}]`,
17
19
  file: '',
18
20
  script: `.[contenthash:${length}]`,
19
21
  },
20
22
  all: {
21
- chunk: `.[chunkhash:${length}]`,
23
+ chunk: `.[contenthash:${length}]`,
22
24
  extract: `.[contenthash:${length}]`,
23
25
  file: `.[contenthash:${length}]`,
24
26
  script: `.[contenthash:${length}]`,
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.1",
4
+ "version": "23.0.2",
5
5
  "type": "commonjs",
6
6
  "files": [
7
7
  "dist",
@@ -152,14 +152,14 @@
152
152
  "tslib": "^2.3.0",
153
153
  "webpack": "5.105.2",
154
154
  "webpack-node-externals": "^3.0.0",
155
- "@nx/devkit": "23.0.1",
156
- "@nx/js": "23.0.1",
157
- "@nx/module-federation": "23.0.1",
158
- "@nx/web": "23.0.1"
155
+ "@nx/devkit": "23.0.2",
156
+ "@nx/js": "23.0.2",
157
+ "@nx/module-federation": "23.0.2",
158
+ "@nx/web": "23.0.2"
159
159
  },
160
160
  "devDependencies": {
161
- "nx": "23.0.1",
162
- "@nx/nest": "23.0.1"
161
+ "nx": "23.0.2",
162
+ "@nx/nest": "23.0.2"
163
163
  },
164
164
  "peerDependencies": {
165
165
  "@rspack/cli": "^1.0.0",