Skip to content

Commit

Permalink
feat(register): add cwd param
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Apr 9, 2022
1 parent e6bc77f commit a1ffdd3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/register.ts
Expand Up @@ -45,13 +45,20 @@ function getCoreModules(
return coreModules;
}

export interface RegisterParams extends ExplicitParams {
/**
* Defaults to `--project` CLI flag or `process.cwd()`
*/
cwd?: string;
}

/**
* Installs a custom module load function that can adhere to paths in tsconfig.
* Returns a function to undo paths registration.
*/
export function register(explicitParams: ExplicitParams): () => void {
export function register(explicitParams?: RegisterParams): () => void {
const configLoaderResult = configLoader({
cwd: options.cwd,
cwd: explicitParams?.cwd ?? options.cwd,
explicitParams,
});

Expand Down

0 comments on commit a1ffdd3

Please sign in to comment.