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

Differentiate "." from "./" in module resolution #9690

Closed
ghost opened this issue Jul 13, 2016 · 0 comments
Closed

Differentiate "." from "./" in module resolution #9690

ghost opened this issue Jul 13, 2016 · 0 comments
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@ghost
Copy link

ghost commented Jul 13, 2016

In my sample node.js project:

a.js:

module.exports = "a.js";

a/index.js:

module.exports = "a/index.js"

We will load a different one of these modules depending on whether the imported module ends in a /.

For example:

a/test.js:

console.log([require("."), require("./")]);

Prints: [ 'a.js', 'a/index.js' ]

Also, if we have:

a/b/test2.js:

console.log([require(".."), require("../")]);

We get: [ 'a.js', 'a/index.js' ]

TypeScript's node.js module resolution should reflect this behavior, but currently does not.
See tests\cases\compiler\relativeModuleWithoutSlash.ts.

@mhegazy mhegazy added the Bug A bug in TypeScript label Jul 13, 2016
@mhegazy mhegazy added this to the TypeScript 2.1 milestone Jul 13, 2016
@mhegazy mhegazy assigned ghost Jul 13, 2016
@ghost ghost closed this as completed in #10510 Sep 14, 2016
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Sep 14, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

1 participant