Skip to content

Inferred base path is wrong when there is a .ts file in node_modules #11977

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

Closed
ghost opened this issue Nov 1, 2016 · 0 comments
Closed

Inferred base path is wrong when there is a .ts file in node_modules #11977

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

Comments

@ghost
Copy link

ghost commented Nov 1, 2016

TypeScript Version: 2.1.0-dev.20161101

Code

node_modules/foo/index.ts: (note the .ts)

export const x = 0;

app/index.ts:

import * as foo from "foo"; foo.x + 1;

app/tsconfig.json:

{
    "compilerOptions": {
        "outDir": "bin"
    }
}

Expected behavior:

Writes to bin/index.js.

Actual behavior:

Writes to bin/app/index.js.

The problem is that getCommonSourceDirectory considers all files, not just the ones that will actually be emitted.

@mhegazy mhegazy added the Bug A bug in TypeScript label Nov 1, 2016
@mhegazy mhegazy assigned ghost Nov 1, 2016
@mhegazy mhegazy added this to the TypeScript 2.1.2 milestone Nov 1, 2016
@ghost ghost closed this as completed in #11993 Nov 11, 2016
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Nov 11, 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