Skip to content
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

Have classic module resolution use @types as a fallback #11147

Merged
1 commit merged into from Oct 6, 2016
Merged

Conversation

ghost
Copy link

@ghost ghost commented Sep 26, 2016

Fixes #11103

This solution is to try loading from @types at the end of classicNameResolver for global modules if all else failed.

I do think that typingsLookupAmd.trace.json is overly long. We climb up to the root of the file system before trying @types. This problem arises because for any target other than commonJS we default to "classic" resolution (moduleResolution = getEmitModuleKind(compilerOptions) === ModuleKind.CommonJS ? ModuleResolutionKind.NodeJs : ModuleResolutionKind.Classic;); it seems like people could be surprised if they switch their emit to ES6 modules and suddenly can't import their packages any more.

@ghost ghost assigned vladima Sep 26, 2016
@ghost ghost force-pushed the classic_at_types branch 2 times, most recently from 8c28901 to 957faff Compare October 5, 2016 20:41
@ghost ghost merged commit 02493de into master Oct 6, 2016
@ghost ghost deleted the classic_at_types branch October 6, 2016 17:48
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants