fix: Don't assume react when importing JSX entrypoints during build (#470)

This commit is contained in:
Aaron
2024-02-20 13:53:00 -06:00
committed by GitHub
parent c258b99cec
commit 1bd7ef56c4
+8 -1
View File
@@ -105,6 +105,13 @@ function getEsbuildOptions(opts: JitiTransformOptions): TransformOptions {
return {
format: 'cjs',
loader: isJsx ? 'tsx' : 'ts',
jsx: isJsx ? 'automatic' : undefined,
...(isJsx
? {
// `h` and `Fragment` are undefined, but that's OK because JSX is never evaluated while
// grabbing the entrypoint's options.
jsxFactory: 'h',
jsxFragment: 'Fragment',
}
: undefined),
};
}