Skip to content

Allow a path mapping to provide a file extension#12103

Merged
5 commits merged into
masterfrom
path_mapping_exact_extension
Nov 11, 2016
Merged

Allow a path mapping to provide a file extension#12103
5 commits merged into
masterfrom
path_mapping_exact_extension

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Nov 8, 2016

Fixes #12098

@ghost ghost force-pushed the path_mapping_exact_extension branch from 299e85f to 1c64615 Compare November 8, 2016 15:19
Comment thread src/compiler/moduleNameResolver.ts Outdated
if (resolved) {
return resolved;
// A path mapping may have a ".ts" extension; in contrast to an import, which should omit it.
const tsExtension = tryGetTypeScriptExtensionFromPath(candidate);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that restricting extensions to only .ts is a right thing here i.e. if user wants to remap some import to .js file. (cc @mhegazy for the opinion)

@ghost ghost merged commit 0e879c0 into master Nov 11, 2016
@ghost ghost deleted the path_mapping_exact_extension branch November 11, 2016 22:22
@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