Skip to content

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

@ianyong

Description

@ianyong

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions