Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't specify just cwd #271

Open
anthony-hayes opened this issue Jun 24, 2024 · 0 comments
Open

Can't specify just cwd #271

anthony-hayes opened this issue Jun 24, 2024 · 0 comments

Comments

@anthony-hayes
Copy link

anthony-hayes commented Jun 24, 2024

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 } );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant