Skip to content

feat(compiler): resolve path aliases in declaration files#3344

Merged
kamilmysliwiec merged 1 commit into
nestjs:masterfrom
maruthang:feat/issue-1749-dts-alias-resolution
Apr 9, 2026
Merged

feat(compiler): resolve path aliases in declaration files#3344
kamilmysliwiec merged 1 commit into
nestjs:masterfrom
maruthang:feat/issue-1749-dts-alias-resolution

Conversation

@maruthang

Copy link
Copy Markdown
Contributor

Summary

  • Adds the tsconfigPathsPlugin transformer to the afterDeclarations phase in both compiler.ts and watch-compiler.ts
  • Previously, path aliases (e.g., @core/*) were only resolved in .js output but left unresolved in .d.ts files
  • This caused broken type resolution when the build output was consumed as a library

The fix is minimal — just 3 lines of production code, reusing the existing transformer.

Closes #1749

Test plan

  • Added 2 new tests verifying path aliases are resolved in .d.ts output
  • Added test fixtures with aliased imports
  • All 153 tests pass (21 suites)
  • Manual test: nest build with path aliases produces .d.ts files with relative imports

@kamilmysliwiec kamilmysliwiec merged commit 41127ce into nestjs:master Apr 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for relative path conversion on .d.ts files

2 participants