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
81fe7bb278
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.
This commit is contained in:
Matthias Stemmler 2025-06-09 12:31:20 +02:00 committed by GitHub
parent 5f7d46354e
commit 659149d87c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5,7 +5,6 @@ import * as rollup from 'rollup';
import { getBabelInputPlugin } from '@rollup/plugin-babel'; import { getBabelInputPlugin } from '@rollup/plugin-babel';
import * as autoprefixer from 'autoprefixer'; import * as autoprefixer from 'autoprefixer';
import { import {
joinPathFragments,
logger, logger,
type ProjectGraph, type ProjectGraph,
readCachedProjectGraph, readCachedProjectGraph,
@ -83,7 +82,7 @@ export function withNx(
const tsConfigPath = const tsConfigPath =
options.buildLibsFromSource || global.NX_GRAPH_CREATION options.buildLibsFromSource || global.NX_GRAPH_CREATION
? joinPathFragments(workspaceRoot, options.tsConfig) ? join(workspaceRoot, options.tsConfig)
: createTmpTsConfig( : createTmpTsConfig(
options.tsConfig, options.tsConfig,
workspaceRoot, workspaceRoot,