mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-06-25 21:56:08 +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"]
|
|
)
|
|
}
|