Skip to content

Typescript build not working as expected with symlinks. #9552

Closed
@micah-williamson

Description

@micah-williamson

TypeScript Version: 2.0.0-dev.20160630

Code

When I use a symlink in Windows I'm getting different build results. I haven't tested this with Mac/Linux yet.

dev
  app
    node_modules
      test
        foo.ts
    index.ts

Builds to:

dev
  app
    bld
      node_modules
        test
          foo.js
      index.js
    ...

Using symlink

mklink /D "c:\dev\app\node_modules\test\" "c:\dev\test\"
dev
  test
    foo.ts
  app
    node_modules
      test => /dev/test
    index.ts

Builds to:

dev
  app
    bld
      app   
        index.js
      test
        foo.js
    ...

Expected behavior:

Building with and without a symlink should build the same.

Actual behavior:

Building without a symlink behaves normally. Building with a symlink does not treat the directory as a link but uses the actual location of the linked directory. This causes problems with module resolution.

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