Skip to content

Can't specify just cwd #271

@anthony-hayes

Description

@anthony-hayes

I want to specify just cwd and have the tool infer the baseUrl read the paths from the tsconfig in my specified cwd.

However, register does not permit that

export interface ExplicitParams {
  baseUrl: string;
  paths: { [key: string]: Array<string> };
  mainFields?: (string | string[])[];
  addMatchAll?: boolean;
  cwd?: string;
}

It'd be nice if I could just specify cwd

For context, I'm using ts-node and tsconfig-paths in a script like the following

const { register } = require('ts-node');
const tsConfigPaths = require('tsconfig-paths');

const cwd = '/path/to/tsconfig/';

// this works
register({ cwd });

// this does not work, need to specify baseUrl and paths
tsConfigPaths.register( { cwd } );

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions