tsc-alias icon indicating copy to clipboard operation
tsc-alias copied to clipboard

Path starting with @ is not replaced

Open razor-x opened this issue 1 year ago • 0 comments

Reproducible in this project https://github.com/seamapi/types at this commit: https://github.com/seamapi/types/commit/68ec4828c2c835d1a0694185d6dcd01fa2fe0a5b

Project defines paths as

{
    "paths": {
      "@seamapi/types": ["./src/index.ts"],
      "@seamapi/types/connect": ["./src/connect.ts"],
      "@seamapi/types/devicedb": ["./src/devicedb.ts"],
      "lib/*": ["./src/lib/*"]
    }
}

And has an import statement

import { schemas as devicedb_schemas } from '@seamapi/types/devicedb'

but in the final output, this import statement is unchanged, however it should be replaced as

import { schemas as devicedb_schemas } from '../../../../../../devicedb.js';

Workaround is adding a custom replacer: https://github.com/seamapi/types/pull/610

razor-x avatar Feb 17 '24 01:02 razor-x