콘텐츠로 이동

TranspileOptions

Defined in: shared/index.ts:24

optional asciiOnly?: boolean

Defined in: shared/index.ts:84

Escape non-ASCII to \uXXXX.


optional browserslist?: string | string[]

Defined in: shared/index.ts:124

browserslist query (e.g. “last 2 versions”, “>1%, not dead”). Takes precedence over target when set. Resolved only in the core package (depends on browserslist).


optional charsetUtf8?: boolean

Defined in: shared/index.ts:86

Do not escape non-ASCII.


optional define?: object[]

Defined in: shared/index.ts:132

Identifier substitution pairs. value is raw JSON (strings must include the surrounding quotes). e.g. [{ key: "process.env.NODE_ENV", value: "\"production\"" }]

key: string

value: string


optional dropConsole?: boolean

Defined in: shared/index.ts:80

Remove console.* calls.


optional dropDebugger?: boolean

Defined in: shared/index.ts:82

Remove debugger statements.


optional emitDecoratorMetadata?: boolean

Defined in: shared/index.ts:92

decorator metadata emit


optional experimentalDecorators?: boolean

Defined in: shared/index.ts:90

legacy decorator transform.


optional filename?: string

Defined in: shared/index.ts:26

File path (used for extension detection, default: “input.ts”).


optional flow?: boolean

Defined in: shared/index.ts:88

Strip Flow types.


optional format?: "esm" | "cjs"

Defined in: shared/index.ts:112

Module format.


optional jsx?: "classic" | "automatic" | "automatic-dev" | "preserve"

Defined in: shared/index.ts:45

JSX runtime. 'preserve' emits JSX unchanged — only TypeScript annotations are stripped. Use this to delegate JSX handling to a downstream tool (e.g. @vitejs/plugin-react, @preact/preset-vite, vite-plugin-solid). Equivalent to tsc "jsx": "preserve".


optional jsxFactory?: string

Defined in: shared/index.ts:47

classic-mode JSX factory (default: “React.createElement”).


optional jsxFragment?: string

Defined in: shared/index.ts:49

classic-mode Fragment factory (default: “React.Fragment”).


optional jsxImportSource?: string

Defined in: shared/index.ts:51

automatic-mode import source (default: “react”).


optional jsxInJs?: boolean

Defined in: shared/index.ts:53

Allow JSX in .js files as well.


optional minify?: boolean

Defined in: shared/index.ts:40

Full minification (whitespace + identifiers + syntax).


optional minifyIdentifiers?: boolean

Defined in: shared/index.ts:36

Minify identifiers.


optional minifySyntax?: boolean

Defined in: shared/index.ts:38

Minify syntax.


optional minifyWhitespace?: boolean

Defined in: shared/index.ts:34

Minify whitespace.


optional platform?: Platform

Defined in: shared/index.ts:116

Target platform.


optional quotes?: "preserve" | "double" | "single"

Defined in: shared/index.ts:114

String quote style.


optional reactRefresh?: boolean

Defined in: shared/index.ts:66

React Fast Refresh transform — registers components via $RefreshReg$(_c, "Name"). Equivalent to the SWC builtin jsc.transform.react.refresh: true / babel-plugin-react-refresh component registration. Used by loaders (rspack-loader, webpack/vite plugin) when enabled on the single-file transpile path.

The default behavior is Metro-compatible (registration only, no hook signatures). The babel/SWC-equivalent hook signature emit is opt-in via reactRefreshHookSignatures: true. Defining the HMR runtime ($RefreshReg$/$RefreshSig$) is the consumer’s responsibility.


optional reactRefreshHookSignatures?: boolean

Defined in: shared/index.ts:78

On top of reactRefresh: true, adds hook signature emit (var _s = $RefreshSig$(); + _s(Component, "sig")). Equivalent to babel-plugin-react-refresh. Default false — preserves the Metro policy (no signatures).

When enabled, the transformer scans hook calls inside function bodies to build the signature string, then emits a _s(Comp, "sig") call right after component registration. RN HMR keeps the default (false), so it is unaffected.


optional sourcemap?: boolean

Defined in: shared/index.ts:28

Generate a source map.


optional sourcemapDebugIds?: boolean

Defined in: shared/index.ts:30

Source map Debug ID (Sentry-compatible).


optional sourceRoot?: string

Defined in: shared/index.ts:126

The source map’s sourceRoot field (default: empty string).


optional sourcesContent?: boolean

Defined in: shared/index.ts:32

Include the original source in the source map (default: true).


optional stopAfter?: "scan" | "parse" | "semantic" | "transform" | "codegen"

Defined in: shared/index.ts:144

Pipeline early-exit point — for debug/profile. When set, all stages after the given phase are skipped and empty output is returned. Useful combined with profile to measure a specific phase’s cost in isolation.

  • “scan”: Scanner token drain only
  • “parse”: after Parser AST construction
  • “semantic”: after the Semantic analyzer
  • “transform”: after the Transformer
  • “codegen”: full run (same as the default behavior)

optional target?: Target

Defined in: shared/index.ts:118

ES downlevel target.


optional tsconfigPath?: string

Defined in: shared/index.ts:103

Path to tsconfig.json (file or directory). When set, compilerOptions are auto-loaded and merged. Fields set explicitly via JS options take precedence — only unspecified fields are filled from the tsconfig values. e.g. ”./tsconfig.json” or ”./project-dir”.


optional tsconfigRaw?: string

Defined in: shared/index.ts:110

Inline tsconfig JSON string (same meaning as esbuild’s tsconfigRaw). When set, both tsconfigPath and autodiscovery are ignored — raw is the single source of truth. The Zig-side tsconfig_merge applies compilerOptions such as jsx/target/decorators directly.


optional useDefineForClassFields?: boolean

Defined in: shared/index.ts:94

Transform class fields → constructor this.x = v (default: true).


optional verbatimModuleSyntax?: boolean

Defined in: shared/index.ts:96

verbatimModuleSyntax (TS 5.0+): when true, unused value imports are not elided.