fix: check jsconfig.json in getPathAliases (#7650)

This commit is contained in:
jyc.dev
2026-01-28 01:56:38 +01:00
committed by Alex Yang
parent 8f3330dae8
commit 9cb459c9f1

View File

@@ -120,7 +120,10 @@ function getPathAliasesRecursive(
}
function getPathAliases(cwd: string): Record<string, string> | null {
const tsConfigPath = path.join(cwd, "tsconfig.json");
let tsConfigPath = path.join(cwd, "tsconfig.json");
if (!fs.existsSync(tsConfigPath)) {
tsConfigPath = path.join(cwd, "jsconfig.json");
}
if (!fs.existsSync(tsConfigPath)) {
return null;
}