Skip to content

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

Merged
1 commit merged into
masterfrom
classic_at_types
Oct 6, 2016
Merged

Have classic module resolution use @types as a fallback#11147
1 commit merged into
masterfrom
classic_at_types

Conversation

@ghost
Copy link
Copy Markdown

@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 from 462f49a to 9c26278 Compare September 26, 2016 16:27
@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 force-pushed the classic_at_types branch from 957faff to 4907fd1 Compare October 6, 2016 13:01
@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.

2 participants