-
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
Different bundle behavior when we have .ts files and .d.ts files #15876
Comments
How are your imports defined? can you share a self contained reproduction of the issue? |
Sure, you can find a repo here https://github.com/soulcorrosion/typescriptSimpleProject
This will link projectA to projectB in node_modules. You can then make the bundle using the target version.
Thank you for looking into this. At the moment we have to dive in some regex to make the paths ok, but it would be great if we could avoid it. |
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed. |
@mhegazy @soulcorrosion added more info to the issue after you added the label. |
this shouldn't be closed, I'm having to resort to manually patching the generated files... |
TypeScript Version: 2.2.1
Code
I have the following folder structure in my development environment.
Both projects have the following tsconfig:
projectB is a dependency of projectA via node_modules. If I make a bundle on projectA, I have the following output:
The dependency module name which equates to the file path is not OK (../). If I remove the moduleB.ts and leave only the typing file (moduleB.d.ts), then the path becomes "projectB/src/moduleB", which is correct.
Also, if both packages were at the same level, it would also work as expected, even with .ts and .d.ts files present.
Expected behavior:
We should get the same behavior when we have .ts files or .d.ts files.
Actual behavior:
If the packages are not at the same level and we have .ts files, the bundle produces wrong names for depenceny modules.
The text was updated successfully, but these errors were encountered: