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

fix(js): handle resolution from within node_module in the sync generator #29412

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions packages/js/src/generators/typescript-sync/typescript-sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,20 @@ export async function syncGenerator(tree: Tree): Promise<SyncGeneratorResult> {
const tsSysFromTree: ts.System = {
...ts.sys,
fileExists(path) {
return tsconfigExists(tree, tsconfigInfoCaches, path);
// Given ts.System.resolve resolve full path for tsconfig within node_modules
// We need to remove the workspace root to ensure we don't have double workspace root within the Tree
const correctPath = path.startsWith(tree.root)
? relative(tree.root, path)
: path;
return tsconfigExists(tree, tsconfigInfoCaches, correctPath);
},
readFile(path) {
return readRawTsconfigContents(tree, tsconfigInfoCaches, path);
// Given ts.System.resolve resolve full path for tsconfig within node_modules
// We need to remove the workspace root to ensure we don't have double workspace root within the Tree
const correctPath = path.startsWith(tree.root)
? relative(tree.root, path)
: path;
return readRawTsconfigContents(tree, tsconfigInfoCaches, correctPath);
},
};

Expand Down
Loading