Skip to content

Commit 2a6848a

Browse files
minh-hoang-trinhBrooooooklyn
authored andcommitted
fix(register): support paths alias with baseUrl
1 parent 1606f3c commit 2a6848a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/register/read-default-tsconfig.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ export function tsCompilerOptionsToSwcConfig(options: ts.CompilerOptions, filena
126126
dynamicImport: true,
127127
esModuleInterop: options.esModuleInterop ?? false,
128128
keepClassNames: true,
129-
paths: options.paths as Options['paths'],
129+
paths: Object.fromEntries(
130+
Object.entries(options.paths ?? {}).map(([aliasKey, aliasPaths]) => [
131+
aliasKey,
132+
(aliasPaths as string[] ?? []).map((path) => resolve(options.baseUrl ?? './', path)),
133+
]),
134+
) as Options['paths'],
130135
}
131136
}

0 commit comments

Comments
 (0)