From 659149d87ca5a72b4231a6ec09517f660ac70e8d Mon Sep 17 00:00:00 2001 From: Matthias Stemmler Date: Mon, 9 Jun 2025 12:31:20 +0200 Subject: [PATCH] fix(bundling): do not normalize tsconfig path for Windows with rollup (#30567) ## Current Behavior Rollup build fails on Windows with errors like this: ``` [plugin rpt2] error TS6059: File '/foo/bar/baz.ts' is not under 'rootDir' 'C:/foo/bar'. 'rootDir' is expected to contain all source files. ``` This is because since https://github.com/nrwl/nx/commit/81fe7bb278826ece0bec9ff794fa5b1ef5c0c295 the `tsconfig` path passed to `rollup-plugin-typescript2` is built using `joinPathFragments`, which removes the drive letter on Windows. ## Expected Behavior Rollup build should not fail. --- packages/rollup/src/plugins/with-nx/with-nx.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/rollup/src/plugins/with-nx/with-nx.ts b/packages/rollup/src/plugins/with-nx/with-nx.ts index 48ac958664..2f204faeb5 100644 --- a/packages/rollup/src/plugins/with-nx/with-nx.ts +++ b/packages/rollup/src/plugins/with-nx/with-nx.ts @@ -5,7 +5,6 @@ import * as rollup from 'rollup'; import { getBabelInputPlugin } from '@rollup/plugin-babel'; import * as autoprefixer from 'autoprefixer'; import { - joinPathFragments, logger, type ProjectGraph, readCachedProjectGraph, @@ -83,7 +82,7 @@ export function withNx( const tsConfigPath = options.buildLibsFromSource || global.NX_GRAPH_CREATION - ? joinPathFragments(workspaceRoot, options.tsConfig) + ? join(workspaceRoot, options.tsConfig) : createTmpTsConfig( options.tsConfig, workspaceRoot,