.jsx and .tsx files natively — no Babel or Webpack configuration required. React works with Bun out of the box.
Create a React app
Usebun init --react to scaffold a full-stack React app with a built-in API server and hot module reloading:
Development
Start the app in development mode with hot reloading:Production
- Build static site
- Run full-stack server
Compile the React app to a Serve the output with any static hosting service, CDN, or Bun’s built-in file server.
dist/ directory:JSX support
Bun transpiles JSX and TSX at runtime without Babel. Thejsx and jsxImportSource settings in tsconfig.json control JSX behavior:
tsconfig.json
.tsx files without any additional configuration:
src/App.tsx
Manual bundling with Bun.build
For more control over the output, useBun.build directly or the bun build CLI:
build.ts