Skip to content

tsconfig "extends" field ignores "exports" field of source package #48665

Closed
@pschiffmann

Description

@pschiffmann

Bug Report

🔎 Search Terms

tsconfig, exports, extends

🕗 Version & Regression Information

I encountered this issue in version typescript@4.7.0-dev.20220408.

Error description

You can use the tsconfig.json extends field to inherit configuration options from another tsconfig file. The base tsconfig file can be located in another package, like demonstrated here.

🙁 Actual behavior

Let's say I'm in package my-app, which contains a tsconfig with "extends": "my-lib/tsconfig-base.json. Typescript ignores the exports field of package my-lib. It will always look for a file tsconfig-base.json in the my-lib root directory, even if an "exports" mapping exists for this name.

🙂 Expected behavior

I expected Typescript to use the standard node resolution algorithm when looking up the tsconfig file on disk, which respects the "exports" field.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Effort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Experience EnhancementNoncontroversial enhancementsHelp WantedYou can do thisSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions