Commit 9c2b5e2
fix(js): preserve tsconfig fields in typescript plugin cache (#34908)
## Current Behavior
After certain cache state transitions (e.g., tsconfig parsing cache warm
but targets cache cold), the `@nx/js/typescript` plugin falls back to
the `production` named input instead of deriving precise inputs from
tsconfig `include`/`exclude` paths. This results in broader cache
invalidation than necessary, and in projects with `allowJs` or
`resolveJsonModule`, the wrong file extensions are tracked as inputs.
Output inference is also affected when `emitDeclarationOnly` or
`declarationMap` are set.
Running `nx reset` restores correct behavior, but the issue recurs.
## Expected Behavior
Inferred inputs and outputs are consistent regardless of cache state —
always matching what the tsconfig actually specifies.
The root cause was the tsconfig parsing cache serialization
(`toAbsolutePaths`/`toRelativePaths`) dropping fields the plugin relies
on: `raw.include`, `raw.exclude`, `raw.files`, and `options.allowJs`,
`options.resolveJsonModule`, `options.emitDeclarationOnly`,
`options.declarationMap`. These are now preserved, and
`TSCONFIG_CACHE_VERSION` is bumped to invalidate stale caches.1 parent 1c7076d commit 9c2b5e2
1 file changed
Lines changed: 39 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| |||
1646 | 1646 | | |
1647 | 1647 | | |
1648 | 1648 | | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
1649 | 1661 | | |
1650 | 1662 | | |
1651 | | - | |
1652 | | - | |
1653 | | - | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
1654 | 1669 | | |
| 1670 | + | |
1655 | 1671 | | |
1656 | 1672 | | |
1657 | 1673 | | |
| |||
1704 | 1720 | | |
1705 | 1721 | | |
1706 | 1722 | | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
| 1728 | + | |
| 1729 | + | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
1707 | 1735 | | |
1708 | 1736 | | |
1709 | | - | |
1710 | | - | |
1711 | | - | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
1712 | 1743 | | |
| 1744 | + | |
1713 | 1745 | | |
1714 | 1746 | | |
1715 | 1747 | | |
| |||
0 commit comments