From 6f9a88b31ba0881acd56fcb62c4a554c867b14d6 Mon Sep 17 00:00:00 2001 From: Erika <3019731+Princesseuh@users.noreply.github.com> Date: Thu, 13 Oct 2022 15:39:32 -0300 Subject: [PATCH] Fix aliases from jsconfig.json not being picked up anymore (#5076) * Fix aliases from jsconfig.json not being picked up anymore * Add changeset --- .changeset/honest-crabs-scream.md | 5 +++++ packages/astro/src/core/config/tsconfig.ts | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 .changeset/honest-crabs-scream.md diff --git a/.changeset/honest-crabs-scream.md b/.changeset/honest-crabs-scream.md new file mode 100644 index 000000000..58dd5f674 --- /dev/null +++ b/.changeset/honest-crabs-scream.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Fix jsconfig.json aliases not working anymore after 1.5.0 diff --git a/packages/astro/src/core/config/tsconfig.ts b/packages/astro/src/core/config/tsconfig.ts index 203a1f634..be73af077 100644 --- a/packages/astro/src/core/config/tsconfig.ts +++ b/packages/astro/src/core/config/tsconfig.ts @@ -62,8 +62,6 @@ export function loadTSConfig(cwd: string | undefined, resolve = true): tsr.TsCon // the file does not exists. We'll manually handle this so we can provide better errors to users if (!resolve && config.reason === 'invalid-config' && !existsSync(join(cwd, 'tsconfig.json'))) { config = { reason: 'not-found', path: undefined, exists: false }; - } else { - return config; } // If we couldn't find a tsconfig.json, try to load a jsconfig.json instead @@ -80,9 +78,9 @@ export function loadTSConfig(cwd: string | undefined, resolve = true): tsr.TsCon !existsSync(join(cwd, 'jsconfig.json')) ) { return { reason: 'not-found', path: undefined, exists: false }; - } else { - return jsconfig; } + + return jsconfig; } return config;