diff --git a/README.md b/README.md index 924278e..7511201 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ esbuild-jest transformer should be used in your Jest config file like this: #### Setting up Jest config file with transformOptions ```typescript export interface Options { + jsx?: 'automatic' | 'classic' jsxFactory?: string jsxFragment?: string sourcemap?: boolean | 'inline' | 'external' diff --git a/src/index.ts b/src/index.ts index e2bca0f..ae41b28 100644 --- a/src/index.ts +++ b/src/index.ts @@ -44,6 +44,7 @@ const createTransformer = (options?: Options) => ({ loader, format: options?.format as Format || 'cjs', target: options?.target || 'es2018', + ...(options?.jsx ? { jsx: options.jsx }: {}), ...(options?.jsxFactory ? { jsxFactory: options.jsxFactory }: {}), ...(options?.jsxFragment ? { jsxFragment: options.jsxFragment }: {}), ...sourcemaps diff --git a/src/options.ts b/src/options.ts index 992e457..4e74368 100644 --- a/src/options.ts +++ b/src/options.ts @@ -1,6 +1,7 @@ import { Loader } from 'esbuild' export interface Options { + jsx?: 'automatic' | 'classic' jsxFactory?: string jsxFragment?: string sourcemap?: boolean | 'inline' | 'external'