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

compilerOptions.paths not resolved when tsconfig extends from another package #3767

Closed
matthewaptaylor opened this issue May 15, 2024 · 1 comment
Labels

Comments

@matthewaptaylor
Copy link

ESBuild correctly follows the TS behaviour of the extends field in tsconfig.json looking into the exports field of a dependency, such as documented in #3058. For example this is resolved:

"extends": "@repo/tsconfig/base"

when the package.json of @repo/tsconfig exports ./base:

{
  "name": "@repo/tsconfig",
  "private": true,
  "version": "0.1.0",
  "exports": {
    "./base": "./base.json"
  }
}

However, if @repo/tsconfig/base includes a compilerOptions.paths property, these aliases cannot be resolved when building and the build fails. The only way for it to be resolved is to instead change the original extends field to a relative import, such as:

"extends": "../../tooling/typescript/base.json"

Paths should be resolved even when extending from a tsconfig from a package.

Please see this reproduction repo

@evanw
Copy link
Owner

evanw commented May 15, 2024

It looks like this has to do with a pnpm-specific "workspace" feature and symlinks.

@evanw evanw added the tsconfig label May 15, 2024
@evanw evanw closed this as completed in 6e6f15f May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants