Skip to content

Commit

Permalink
Only read from tsconfig if not found earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp committed Sep 14, 2022
1 parent 947cbcf commit 7c6c8e1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/astro/src/vite-plugin-jsx/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 7c6c8e1

Please sign in to comment.