esbuild React CLI
raw JSON → 0.2.2 verified Fri May 01 auth: no javascript
esbuild-react is a CLI tool (v0.2.2) for scaffolding barebones React projects that compile with esbuild for maximum speed. It is built with oclif and offers optional choices for TypeScript or JavaScript and npm or Yarn as package managers. The package is stable but has very low download volume and appears to be a small utility rather than a widely maintained library. It requires Node >=8.0.0 and ships TypeScript types. Differentiators include its singular focus on fast esbuild-based setup versus alternatives like create-react-app.
Common errors
error Error: Cannot find module 'esbuild-react' ↓
cause Package not installed globally or missing from node_modules.
fix
Run
npm install -g esbuild-react or use npx esbuild-react. error 'esbuild' is not recognized as an internal or external command ↓
cause esbuild not installed; the CLI may assume esbuild is globally available.
fix
Add esbuild as a dependency:
npm install --save-dev esbuild. Warnings
gotcha The CLI may require Node >=8.0.0, but newer Node versions (>=14) are recommended for esbuild compatibility. ↓
fix Use Node v14+ for best results.
gotcha The package has not been updated since 2021; check for compatibility with latest React and esbuild versions. ↓
fix Consider using Vite or create-react-app with esbuild if issues arise.
Install
npm install esbuild-react yarn add esbuild-react pnpm add esbuild-react Imports
- default wrong
const esbuildReact = require('esbuild-react')correctimport esbuildReact from 'esbuild-react' - run CLI wrong
esbuild-react my-app --lang=javascriptcorrectnpx esbuild-react my-app -l=typescript -p=npm
Quickstart
npx esbuild-react my-react-app -l=typescript -p=npm
cd my-react-app
npm start