Skip to content

listFiles[Only] does not list upstream package.json files whose exports were used for path resolution #60629

Closed as not planned
@ddurschlag

Description

@ddurschlag

🔎 Search Terms

listFiles listFilesOnly package.json exports

🕗 Version & Regression Information

  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about listFiles

I tried 3.9.5 which also doesn't list the upstream package.json (though it actually doesn't list the .d.ts file either, so that's even worse).

⏯ Playground Link

https://github.com/ddurschlag/typescript-listFiles-demo/

💻 Code

When doing a bare import:

import { sayHello } from 'upstream';

...if the upstream module's exports are specified in the package.json:

  "exports": {
    ".": "./dist/specific_name.js",
    "./*": "./dist/*"
  }

tsc's listFiles and listFilesOnly features do not list this package.json. This is problematic for, e.g., detecting if the project has changed such that a rebuild may be required.

🙁 Actual behavior

Upstream package.json was not listed in the file output.

🙂 Expected behavior

Upstream package.json is listed in the file output.

Additional information about the issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions