-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use
get-tsconfig
instead of tsconfig-paths
update ora, remove unsed semver
- Loading branch information
1 parent
384c87a
commit 6a849f5
Showing
4 changed files
with
63 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
import { type ConfigLoaderSuccessResult, createMatchPath } from 'tsconfig-paths' | ||
import { createPathsMatcher, type TsConfigResult } from 'get-tsconfig' | ||
|
||
export function resolveImport( | ||
importPath: string, | ||
config: Pick<ConfigLoaderSuccessResult, 'absoluteBaseUrl' | 'paths'>, | ||
) { | ||
return createMatchPath(config.absoluteBaseUrl, config.paths)( | ||
importPath, | ||
undefined, | ||
() => true, | ||
['.ts', '.tsx', '.vue'], | ||
) | ||
export function resolveImport(importPath: string, config: TsConfigResult) { | ||
const matcher = createPathsMatcher(config) | ||
if (matcher === null) { | ||
return | ||
} | ||
const paths = matcher(importPath) | ||
return paths[0] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.