-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Use common source directory for calculating concatenated module paths #5661
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
Use common source directory for calculating concatenated module paths #5661
Conversation
👍 |
can you give this a try on #5471 and see if it failed tests @sheetalkamat is seeing? |
@weswigham you would need to make sure when running project test cases (with #5471) that there are no *.dts.errors.txt is generated |
Additionally, I needed to change |
I've been able to merge this PR with #5471 locally and the tests all pass except So it looks good now. 👍 |
@weswigham I don't think it is good idea to calculate common source directory irrespective of options. We should be calculating it only for the options that use it. Because first it is unnecessary and second it should be reporting error on not finding common source directory and it would be wrong to do that if we aren't going to use it. |
@sheetalkamat: what about if I defer the error reporting until |
@sheetalkamat on that - I've actually already deferred it to error at the same time it would have before in #5590. Taken together they seem fine. |
@weswigham Question is should it be error if there is no common source directory when --outFile is specified? I guess not. Can you add a test case with such scenario, so we can see how the output will look especially in case of combining external modules. I still don't like the idea that we do work related to finding common source directory when its not needed. Special consideration to project with lots of sources. |
@sheetalkamat: Maybe it would simply be best to actually put the generation of a common source directory within the get common source directory function (Including logic to cache it), then? (And calling it in |
Also, I will add a test for that - I'm not sure what we do for that today. |
@sheetalkamat do you wanna look at this again? |
👍 |
A question though... should --rootDir be used if specified as common source directory? |
It is used - it gets set as the value of |
@weswigham but that happens only if --outDir, --sourcRoot or --mapRoot |
@sheetalkamat correct. I guess it would be possible to use |
Use common source directory for calculating concatenated module paths
Rather than the current directory.