Skip to content

Fix tsconfig.json detection#770

Merged
styfle merged 2 commits intomainfrom
fix-tsconfig-json-treewalking
Sep 13, 2021
Merged

Fix tsconfig.json detection#770
styfle merged 2 commits intomainfrom
fix-tsconfig-json-treewalking

Conversation

@styfle
Copy link
Copy Markdown
Contributor

@styfle styfle commented Sep 13, 2021

This PR fixes a bug seen in PR vercel/vercel#6700 (see logs) where the tsconfig.json is in a parent directory.

The tsconfig-paths package was returning an error Missing baseUrl in compilerOptions.

So instead, we'll manually walk up the filesystem to find the relevant tsconfig.json like we do in @vercel/build-utils.


if (process === null || process === void 0 ? void 0 : process.env.FOO) {
console.log('foo');
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TooTallNate Here we can see the optional chaining operator is properly down-leveled 😌

@styfle styfle enabled auto-merge (squash) September 13, 2021 02:35
Copy link
Copy Markdown

@mrmckeb mrmckeb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth extracting walkParentDirs out, but not sure where...

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.

2 participants