Interface TranspilerOptions

Hierarchy

  • TranspilerOptions

Properties

allowBunRuntime?: boolean
autoImportJSX?: boolean
define?: Record<string, string>

Replace key with value. Value must be a JSON string.

Example

 { "process.env.NODE_ENV": "\"production\"" }
exports?: { eliminate?: string[]; replace?: Record<string, string> }

Type declaration

  • Optional eliminate?: string[]
  • Optional replace?: Record<string, string>
jsxOptimizationInline?: boolean

What is the default loader used for this transpiler?

macros?: MacroMap

Replace an import statement with a macro.

This will remove the import statement from the final output and replace any function calls or template strings with the result returned by the macro

Example

   {
"react-relay": {
"graphql": "bun-macro-relay"
}
}

Code that calls graphql will be replaced with the result of the macro.

import {graphql} from "react-relay";

// Input:
const query = graphql`
query {
... on User {
id
}
}
}`;

Will be replaced with:

import UserQuery from "./UserQuery.graphql";
const query = UserQuery;
platform?: Platform

Example

"browser"
treeShaking?: boolean
trimUnusedImports?: boolean
tsconfig?: string

TSConfig.json file as stringified JSON or an object Use this to set a custom JSX factory, fragment, or import source For example, if you want to use Preact instead of React. Or if you want to use Emotion.

Generated using TypeDoc