Skip to main content
Bun supports .jsx and .tsx files natively — no Babel or Webpack configuration required. React works with Bun out of the box.

Create a React app

Use bun init --react to scaffold a full-stack React app with a built-in API server and hot module reloading:
This generates a project with the following structure:

Development

Start the app in development mode with hot reloading:
This starts both the API server and the React frontend in a single process with hot module replacement (HMR). Changes to any file are reflected immediately in the browser.

Production

Compile the React app to a dist/ directory:
Serve the output with any static hosting service, CDN, or Bun’s built-in file server.

JSX support

Bun transpiles JSX and TSX at runtime without Babel. The jsx and jsxImportSource settings in tsconfig.json control JSX behavior:
tsconfig.json
You can also use JSX in .tsx files without any additional configuration:
src/App.tsx

Manual bundling with Bun.build

For more control over the output, use Bun.build directly or the bun build CLI:
build.ts

Using Vite

If you prefer Vite’s ecosystem, scaffold a React + Vite project with:
bun create is an alias for bunx create-*. It fetches the template package from npm, runs the scaffolding, and installs dependencies — all in one step.