Closed Jack-Works closed 2 weeks ago
Hello @Jack-Works, thanks for highlighting this. Your repro is using reference directives in the project's public-facing entrypoint module.
/// <reference path="./env.d.ts" />
It's true there is an intentional breaking change introduced by @jakebailey in the PR for Do not preserve references in declaration emit, unless preserve=true. And this is not yet documented in the TS 5.5 Beta announcement. so that post should be updated.
The intended workaround for cases where you want the reference directive included in the published declaration file is to add preserve=true
.
/// <reference path="./env.d.ts" preserve=true/>
I'd suggest re-titling this issue:
Undocumented breaking change in 5.5.0-beta for reference directives
Sorry about that; it definitely was meant to be there in the blog! We'll get it updated.
🔎 Search Terms
5.5.0-beta
🕗 Version & Regression Information
⏯ Playground Link
https://github.com/Jack-Works/reproduce
💻 Code
Clone the repo
🙁 Actual behavior
Global augmentation no longer works in 5.5.0-beta across different projects. (
pnpm run new
)🙂 Expected behavior
Global augmentation works in 5.4 across different projects. (
pnpm run old
)Additional information about the issue
Global augmentation across different projects is an important ability. Here are some examples: