Closed nicknotfun closed 1 year ago
Here is what I believe is needed: https://github.com/jonkwheeler/tsconfig-replace-paths/pull/28
I believe I have some free time coming up here soon. Maybe this week or next. Hopefully I can look at this and a few other things while on my paternity leave 🙃ðŸ¤
Thanks! and congrats! For what it's worth I switched to using a fork with the PR and it certainly does fix the issue.
I'd phrase the problem as it's not correctly handling the ambiguity of package names when a directory and file have the same base name.
Yo when you get a sec can you send me a dummy repo with the issue?
Before I go digging further, I noticed this is how I have all my repos setup which use this package to publish... I have rootDir
set.
"rootDir": "./src",
"baseUrl": ".",
"paths": {
"@components": ["./src/components"],
"@components/*": ["./src/components/*"],
"@root": ["./"],
"@root/*": ["./*"],
"@utils": ["./src/utilities"],
"@utils/*": ["./src/utilities/*"],
"@vars": ["./src/variables"],
"@vars/*": ["./src/variables/*"]
},
So I'm wondering if the baseUrl is not being accounted for correctly, or simply switching your config to use rootDir
would work.
We just ran into this with our project, with the typescript (pre-compiled) state of:
The rewritten output we get in bar.ts is:
What I believe may be happening is it's mistakenly assuming a folder import (ala if index.ts existed); however in this circumstance there is no index.ts and it should instead generate "../foo.js"
Does this sound correct or might we have something more nuanced missing in our setup?