-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
TS importModuleSpecifier could work better for lerna monorepos with libs only #36624
Comments
Can you provide a small example project that shows what doesn't work today and explain the expected behavior? |
This comment has been minimized.
This comment has been minimized.
Sorry for the delay. Here is the repo: https://github.com/lgraziani2712/vscode-88977 Here is a comment in the built file: lgraziani2712/vscode-88977@07e82a9#r37005671 |
Moving upstream for feedback from TS team |
I'm having the same issue. I've had this issue since the beginning of my monorepo 1.5 years ago. Finally this issue gave me a direction. I'd love to give more context if that would help. More issues I found that might be related: #36235, #35768, #20110 |
Actually, this sounds like expected behavior. Most of what’s described in this issue, including 100% of the problem in @lgraziani2712’s example repo, is essentially a duplicate of #31869, and would be solved by implementing that proposal. It does leave open the issue of trying to use a common set of
The intention is probably:
To accomplish this, even if #31869 is implemented, each project would need its own |
TS Template added by @mjbvz
TypeScript Version: 3.8.0
Search Terms
Related issue: #36181 (I thought was something related to TS itself, but maybe is not).
Right now, the
typescript.preferences.importModuleSpecifier
auto option only uses relative paths for files nearer to the actual file than thebasePath
configuration file. But this isn't the best approach for a monorepo full with libs.I only want to have aliases on imports from other lib folders, but I want to keep every import within a lib as relative imports. The problem is, VSCode suggestions sometimes adds the alias to imports within files of the same lib. When I build and publish everything as is, the service using that lib will crash because doesn't understand the alias.
Thank you in advance!
The text was updated successfully, but these errors were encountered: