diff --git a/packages/core/index.ts b/packages/core/index.ts index 97cc706ef..071675fb6 100644 --- a/packages/core/index.ts +++ b/packages/core/index.ts @@ -22,6 +22,7 @@ export interface Options { keepClassNames?: boolean externalHelpers?: boolean react?: Partial + baseUrl?: string paths?: { [from: string]: [string] } diff --git a/packages/register/read-default-tsconfig.ts b/packages/register/read-default-tsconfig.ts index 3c41e41b1..9f98cf1b8 100644 --- a/packages/register/read-default-tsconfig.ts +++ b/packages/register/read-default-tsconfig.ts @@ -120,6 +120,7 @@ export function tsCompilerOptionsToSwcConfig(options: ts.CompilerOptions, filena useBuiltins: true, } : undefined, + baseUrl: resolve(options.baseUrl ?? './'), paths: Object.fromEntries( Object.entries(options.paths ?? {}).map(([aliasKey, aliasPaths]) => [ aliasKey,