From 7c6c8e193a693cee955d4568c5de701cba5d1574 Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Wed, 14 Sep 2022 16:33:41 -0400 Subject: [PATCH] Only read from tsconfig if not found earlier --- packages/astro/src/vite-plugin-jsx/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/astro/src/vite-plugin-jsx/index.ts b/packages/astro/src/vite-plugin-jsx/index.ts index 4ed7c2a5b578..9f42b0fa9080 100644 --- a/packages/astro/src/vite-plugin-jsx/index.ts +++ b/packages/astro/src/vite-plugin-jsx/index.ts @@ -229,8 +229,10 @@ export default function jsx({ config, logging }: AstroPluginJSXOptions): Plugin } // Check the tsconfig - const compilerOptions = config._ctx.tsConfig?.compilerOptions; - importSource = (compilerOptions as FixedCompilerOptions | undefined)?.jsxImportSource; + if(!importSource) { + const compilerOptions = config._ctx.tsConfig?.compilerOptions; + importSource = (compilerOptions as FixedCompilerOptions | undefined)?.jsxImportSource; + } // if we still can’t tell the import source, now is the time to throw an error. if (!importSource && defaultJSXRendererEntry) {