Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,22 @@ export interface BuildOptions {
*/
experimentalDecorators?: boolean;
useUnknownInCatchVariables?: boolean;

/**
* Controls how JSX constructs are emitted in JavaScript files.
*
* See more: https://www.typescriptlang.org/tsconfig/#jsx
* @default ts.JsxEmit.React
*/
jsx: ts.JsxEmit;
/**
* @default "React.createElement"
*/
jsxFactory: string;
/**
* @default "React.Fragment"
*/
jsxFragmentFactory: string;
};
/** Filter out diagnostics that you want to ignore during type checking and emitting.
* @returns `true` to surface the diagnostic or `false` to ignore it.
Expand Down Expand Up @@ -293,9 +309,10 @@ export async function build(options: BuildOptions): Promise<void> {
false,
emitDecoratorMetadata: options.compilerOptions?.emitDecoratorMetadata ??
false,
jsx: ts.JsxEmit.React,
jsxFactory: "React.createElement",
jsxFragmentFactory: "React.Fragment",
jsx: options.compilerOptions?.jsx ?? ts.JsxEmit.React,
jsxFactory: options.compilerOptions?.jsxFactory ?? "React.createElement",
jsxFragmentFactory: options.compilerOptions?.jsxFragmentFactory ??
"React.Fragment",
importsNotUsedAsValues: ts.ImportsNotUsedAsValues.Remove,
module: ts.ModuleKind.ESNext,
moduleResolution: ts.ModuleResolutionKind.Bundler,
Expand Down
Loading