feat(plugin-dts): support custom tsconfig for DTS bundling - #1862
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for specifying a dedicated TypeScript config for the API Extractor bundling phase of DTS generation, while keeping the existing tsconfig for the declaration emit phase. This improves compatibility for projects that need different paths/module-resolution settings when analyzing the emitted .d.ts outputs.
Changes:
- Introduces
dts.bundle.tsconfigPath(and plugin counterpartbundle.tsconfigPath) and wires it through to API Extractor with project-root resolution and normalized absolute paths. - Refactors bundling flow to distinguish emit tsconfig vs bundle tsconfig, and improves the “missing declaration entry” error location (checked before invoking API Extractor).
- Adds an integration fixture + assertions to validate separate tsconfig behavior, and updates English/Chinese docs.
Reviewed changes
Copilot reviewed 16 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| website/docs/zh/config/lib/dts.mdx | Documents dts.bundle.tsconfigPath and updates the dts.bundle type signature (ZH). |
| website/docs/en/config/lib/dts.mdx | Documents dts.bundle.tsconfigPath and updates the dts.bundle type signature (EN). |
| packages/core/src/types/config.ts | Adds typed config support + JSDoc for dts.bundle.tsconfigPath. |
| packages/plugin-dts/src/types/options.ts | Extends bundle options type to include tsconfigPath. |
| packages/plugin-dts/src/types/internal.ts | Adds bundleTsconfigPath to internal generation options. |
| packages/plugin-dts/src/index.ts | Resolves bundle.tsconfigPath from project root and passes it through as bundleTsconfigPath. |
| packages/plugin-dts/src/dts.ts | Uses separate emit/bundle tsconfig paths; moves missing-entry validation to pre-API-Extractor stage. |
| packages/plugin-dts/src/apiExtractor.ts | Requires a tsconfig path and normalizes it before passing to API Extractor. |
| packages/plugin-dts/README.md | Documents bundle.tsconfigPath and updates option type signature. |
| tests/integration/dts/bundle/index.test.ts | Adds integration assertions for separate tsconfig usage during bundling. |
| tests/integration/dts/bundle/tsconfig-path/package.json | Adds a new integration fixture package. |
| tests/integration/dts/bundle/tsconfig-path/rslib.config.ts | Configures fixture to use dts.bundle.tsconfigPath for API Extractor. |
| tests/integration/dts/bundle/tsconfig-path/src/index.ts | Fixture entry importing via a TS path alias. |
| tests/integration/dts/bundle/tsconfig-path/tsconfig.json | Emit-phase tsconfig with paths pointing to source. |
| tests/integration/dts/bundle/tsconfig-path/tsconfig.bundle.json | Bundle-phase tsconfig overriding paths to point to generated .d.ts. |
| tests/integration/dts/bundle/tsconfig-path/generated-dts/foo/index.d.ts | Fixture “analysis-phase” declaration target used by API Extractor. |
| tests/integration/dts/bundle/tsconfig-path/workspace/foo/src/index.ts | Fixture “emit-phase” source target for the alias. |
| pnpm-lock.yaml | Registers the new integration fixture as a pnpm importer. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Deploying rslib with
|
| Latest commit: |
8b0c97c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ef10b19d.rslib.pages.dev |
| Branch Preview URL: | https://david-feat-dts-bundle-tsconf.rslib.pages.dev |
elecmonkey
approved these changes
Aug 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dts.bundle.tsconfigPathso API Extractor can use a separate TypeScript config from declaration emit while defaulting tosource.tsconfigPath.bundledPackages.Checklist