Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[@rollup/plugin-typescript] Declaration files for type-only source files that are not explicitly included are not emitted #1554

Closed
ianyong opened this issue Aug 5, 2023 · 0 comments · Fixed by #1555

Comments

@ianyong
Copy link
Contributor

ianyong commented Aug 5, 2023

Expected Behavior

This issue does not occur with the TypeScript compiler because files that meet the two conditions below but are imported/exported from another source file that is part of the filenames or patterns in the include compiler option are still emitted.

Actual Behavior

When the include compiler option is specified in tsconfig.json, @rollup/plugin-typescript does not emit declaration files (.d.ts) for source files which:

  1. Only contain types (i.e., does not contain any code which is transpiled to JavaScript); and
  2. Are not part of the filenames or patterns in the include compiler option.

When the above conditions are met, the type definitions in the affected files are not part of the Rollup build output even if they are imported/exported from another source file that is part of the filenames or patterns in the include compiler option.

Additional Information

Given the same tsconfig.json, I would expect the same set of type definitions to be outputted by @rollup/plugin-typescript & the TypeScript compiler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant