Skip to content

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

@ghost

Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions