-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
Compiler API to resolve path from ImportDeclaration #28276
Labels
API
Relates to the public API for TypeScript
In Discussion
Not yet reached consensus
Suggestion
An idea for TypeScript
Comments
ts.resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference): ResolvedModuleWithFailedLookupLocations; For your use case you can ignore the last parameter ts.createModuleResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string): ModuleResolutionCache; |
Thanks a lot for the help! I gave that a try but unfortunately |
weswigham
added
Suggestion
An idea for TypeScript
In Discussion
Not yet reached consensus
API
Relates to the public API for TypeScript
labels
Nov 1, 2018
5 tasks
Now that the original question has been answered, wouldn't this be a duplicate of #28770? |
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
API
Relates to the public API for TypeScript
In Discussion
Not yet reached consensus
Suggestion
An idea for TypeScript
Hi there, since TS supports
paths
intsconfig.json
, is there an API in the compiler (Program
,CompilerHost
or something) to programmatically resolve real path of an import?I wrote this transformer https://github.com/longlho/ts-transform-css-modules and it's tripping up on paths that are aliased in
tsconfig.json
, e.g:tsconfig.json
I can try to manually reconstruct TS resolver but rather not to.
Thanks!
The text was updated successfully, but these errors were encountered: