Skip to content

support module references in extends (checking default tsconfig.json filename) #27

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

holvi-sebastian
Copy link

I noticed using vitest with unplugin-swc that loading typescript configuration fails when referencing a module without filename.

Typescript itself and esbuild allow extending a tsconfig that is references as a module or path, without a filename.

E.g. when a tsconfig.json file is exported in a node_module called my-tsconfig-module (for example in a monorepo where a tsconfig module is a workspace that's symlinked to other packages as a module dependency)

Then your tsconfig can reference it as:

{
   "extends": "my-tsconfig-module"
}

And typescript will search for a /my-tsconfig-module dir in node_modules and look for a tsconfig.json file in it by default.

This PR adds a try / catch to handle this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant