Skip to content

Output directory messed up if tsc is triggered as VS Code task. #8837

@vilicvane

Description

@vilicvane

This only happens if tsc is executed via Code.

TypeScript Version:

nightly (1.9.0-dev.20160525-1.0)

Code

.vscode/tasks.json

{
    "version": "0.1.0",
    "command": "node", // Using npm scripts would result the same.
    "isShellCommand": true,
    "args": ["node_modules/typescript/lib/tsc.js"],
    "showOutput": "silent",
    "problemMatcher": "$tsc"
}

tsconfig.json

{
    "compilerOptions": {
        "module": "commonjs",
        "allowJs": true,
        "outDir": "bld",
        "rootDir": "src"
    },
    "exclude": [
        "node_modules",
        "bld"
    ]
}

src/foo/bar.ts

import '../biu/pia';

src/biu/pia.js

// Empty file.

Expected behavior:

Compiles correctly.

Actual behavior:

error TS5055: Cannot write file '.../src/biu/pia.js' because it would overwrite input file.

And if you put another .ts file and import it in src/foo.bar.ts, it would be output as .js file nested to its .ts source.

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