Skip to content

Import update on file move not working for non-relative file paths #24544

@mjbvz

Description

@mjbvz

From microsoft/vscode#50707

TypeScript Version: 3.0.0-dev.20180530

Search Terms:

  • update paths on file move
  • base url
  • non-relative

Code

  1. Clone this project: https://github.com/mjbvz/ts-update-paths-non-relative

The basic structure is:

tsconfig.json
sub/ 
    a.ts
    b.ts

tsconfig.json:

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es2016",
        "jsx": "preserve",
        "baseUrl": "."
    },
    "exclude": [
        "node_modules",
        "**/node_modules/*"
    ]
}

a.ts:

export const a = 123; 

b.ts

import { a } from 'sub/a';

export const b = 123;

console.log(a) 
  1. Rename sub/a.ts to sub/z.ts

Expected behavior:
Prompt to update paths

Actual behavior:
No prompt. This works if you use relative paths

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issueVS Code TrackedThere is a VS Code equivalent to this issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions