-
-
Notifications
You must be signed in to change notification settings - Fork 615
Description
- Rollup Plugin Name:
@rollup/plugin-typescript - Rollup Plugin Version: 11.1.2
- Rollup Version: 3.27.2
- Operating System (or Browser): Not relevant? I have reproduced the issue in both Ubuntu 22.04.2 & macOS 13.4.1 if it matters.
- Node Version: 18.17.0
- Link to reproduction (
⚠️ read below): https://github.com/ianyong/rollup-plugin-typescript-missing-declaration-files
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:
- Only contain types (i.e., does not contain any code which is transpiled to JavaScript); and
- Are not part of the filenames or patterns in the
includecompiler 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.