Skip to content

Commit

Permalink
feat: update jsx options
Browse files Browse the repository at this point in the history
  • Loading branch information
yuusheng committed Jan 5, 2024
1 parent ef9810f commit 1e3a666
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Custom alias map used to resolve ids.

- Type: Boolean
- Default: `false`
- Environment Variable: `JITI_ENABLE_JSX`
- Environment Variable: `JITI_JSX`

Enable JSX support.

Expand Down
4 changes: 2 additions & 2 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { destr } from "destr";
import { lt } from "semver";
import objectHash from "object-hash";

import type { JITIOptions } from "./types";
import type { JITIOptions, JsxOption } from "./types";

const _EnvDebug = destr<boolean>(process.env.JITI_DEBUG);
const _EnvCache = destr<boolean>(process.env.JITI_CACHE);
Expand All @@ -13,7 +13,7 @@ const _EnvAlias = destr<Record<string, string>>(process.env.JITI_ALIAS);
const _EnvTransform = destr<string[]>(process.env.JITI_TRANSFORM_MODULES);
const _EnvNative = destr<string[]>(process.env.JITI_NATIVE_MODULES);
const _ExpBun = destr<string[]>(process.env.JITI_EXPERIMENTAL_BUN);
const _EnvJsx = destr<boolean>(process.env.JITI_ENABLE_JSX);
const _EnvJsx = destr<boolean | JsxOption>(process.env.JITI_JSX);

const jitiDefaults: JITIOptions = {
debug: _EnvDebug,
Expand Down
5 changes: 3 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
interface JsxOption {
// `@babel/preset-react` config, reference: https://babeljs.io/docs/babel-preset-react#development
export interface JsxOption {
pragma?: string;
pragmaFrag?: string;
throwIfNamespace?: boolean;
runtime?: "classic";
runtime?: "classic" | "automatic";
}

export type TransformOptions = {
Expand Down

0 comments on commit 1e3a666

Please sign in to comment.