-
Notifications
You must be signed in to change notification settings - Fork 105
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
Absolute base url calculated relative to running code, not tsconfig path #7
Comments
Also looks like there is an issue with matching paths related to baseUrl.
(client placed right in
So no one path related to baseUrl will be handled except explicitly added IDE (VSCode) works well with config above Update
solves this (second) issue, but looks ugly 😟 |
Could you create a minimal repro that shows your problem? It's easier to debug something that is runnable. |
@Jontem i tried to reproduce same folders/package.json structure here
see an error
then
and this will work
fixes with passing absolute |
First if you specify a relative baseUrl it will be resolved relative to where tsconfig.json is. As stated in README. Second your path mappings will work if looking like this paths: {
"*": ["./*"],
"shared/*": ["../shared/*"]
} |
yep, and it's correclty mapped to
yep, i wrote this at second post, but it looks ugly - typescript correctly understand paths related to |
So if i understand you correct is that you would like tsconfig-paths to resolve modules relative to baseUrl without having to specify a path mapping explicitly? |
@Jontem yep, imho |
I've made an implementation of this in the commit cb18815 I have just quickly tested it and it seems to work. I'll release it when i have more time to verify. But please try it out. |
@Jontem it works, thx |
Fixed in 2.2.0 |
I have this app structure
with
inside index.js
tsconfig basUrl configured as
to allow imports like
import {} from 'service1/smth'
but
tsconfig-paths
makes wrong absolute path for this baseUrlinstead of just
.../services/
https://github.com/jonaskello/tsconfig-paths/blob/master/src/config-loader.ts#L35
The text was updated successfully, but these errors were encountered: