-
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
"moduleResolution": "node" usage and absolute/relative imports #5304
Comments
node module resolution mimics the way how node looks for modules in runtime (resolution algorithm can be found here). In your case name is not relative - module will always be searched as node module using folder walk and lookup inside Out of curiosity, why do you want to use |
I see, makes sense. It is because of Angular 2, it looks like the type definitions work better if I use this option, whereas every time I use the classic resolution I get into trouble with some typings. But it looks like 5039 will solve my issue. Is there a eta on that? Or is it available on the nightly builds? |
we plan to start working on this issue quite soon |
That sounds great. Looking forward 👍 |
Any news here? With angular2 success i think will be really important to resolve modules starting to rootDir with node moduleResolution setting. |
Same here - we are doing really fancy stuff and need more flexibility regarding import paths. Your suggestion regarding paths similar to systemjs import settings in 5039 would help a lot! |
Same problem. Any solution? |
please see the documentation in #5039, and the implementation should be in |
I have recently ran into some issues after having added
"moduleResolution": "node"
to mytsconfig.json
:The folder structure of the project looks like:
The problem is that when I
import { Animation } from 'common/animation';
it tells me that it cannot find the module, so I have to useimport { Animation } from '../../../common/animation';
. Is it really necessary to have the path as such? And why does it not try to resolve thecommon/animation
relative torootDir
?The text was updated successfully, but these errors were encountered: