mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-07-09 06:55:07 +00:00
14 lines
353 B
TypeScript
14 lines
353 B
TypeScript
import { createMatchPath, type ConfigLoaderSuccessResult } from "tsconfig-paths"
|
|
|
|
export async function resolveImport(
|
|
importPath: string,
|
|
config: Pick<ConfigLoaderSuccessResult, "absoluteBaseUrl" | "paths">
|
|
) {
|
|
return createMatchPath(config.absoluteBaseUrl, config.paths)(
|
|
importPath,
|
|
undefined,
|
|
() => true,
|
|
[".ts", ".tsx"]
|
|
)
|
|
}
|