{"id":26145,"library":"react-app-rewired-esbuild","title":"react-app-rewired-esbuild","description":"A plugin for react-app-rewired that replaces Babel and Terser with esbuild for faster builds in Create React App projects. Current version 0.0.11 is stable but young, with low community adoption. Key differentiator: minimal config integration into existing react-app-rewired setups. Compared to alternatives like CRACO or custom Webpack config, it offers an easy drop-in replacement. Release cadence is low; latest version unchanged since 2021. Not recommended for production due to missing React JSX transform auto-injection.","status":"active","version":"0.0.11","language":"javascript","source_language":"en","source_url":"https://github.com/fupengl/react-app-rewired-esbuild","tags":["javascript","react-scripts","react-app","esbuild","react-app-rewired","customize-cra"],"install":[{"cmd":"npm install react-app-rewired-esbuild","lang":"bash","label":"npm"},{"cmd":"yarn add react-app-rewired-esbuild","lang":"bash","label":"yarn"},{"cmd":"pnpm add react-app-rewired-esbuild","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required to override react-scripts configuration","package":"react-app-rewired","optional":false}],"imports":[{"note":"default export is a function; named import will fail. CJS only, no ESM export.","wrong":"const { rewiredEsbuild } = require('react-app-rewired-esbuild');","symbol":"default (function rewiredEsbuild)","correct":"const rewiredEsbuild = require('react-app-rewired-esbuild');"},{"note":"rewiredEsbuild must be called (returns a function) when used with customize-cra's override.","wrong":"module.exports = override(rewiredEsbuild);","symbol":"rewiredEsbuild (Customize CRA pattern)","correct":"module.exports = override(rewiredEsbuild());"},{"note":"Options are passed directly as first argument, not nested under a property name.","wrong":"rewiredEsbuild({ ESBuildLoaderOptions: { loader: 'tsx' } })","symbol":"ESBuildLoaderOptions","correct":"rewiredEsbuild({ loader: 'tsx', target: 'es2020' })"}],"quickstart":{"code":"// config-overrides.js\nconst rewiredEsbuild = require('react-app-rewired-esbuild');\n\nmodule.exports = function override(config, env) {\n  // add your other config overrides here\n  return rewiredEsbuild()(config, env);\n};","lang":"javascript","description":"Overriding CRA config with react-app-rewired to use esbuild for faster development builds."},"warnings":[{"fix":"Add 'import React from 'react' at the top of every JSX file, or use esbuild's automatic JSX runtime injection via jsxFactory and jsxFragment.","message":"JSX files may fail with 'ReferenceError: React is not defined' since esbuild does not auto-inject the React import.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Consider using CRACO with esbuild-loader directly, or migrate to Vite (which uses esbuild natively).","message":"The underlying esbuild-loader is being superseded by direct esbuild integration in newer build tools, but this package has not been updated since 2021.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Check react-scripts version; for v5, you may need to patch config-overrides.js or use an alternative like CRACO.","message":"This package only works with CRA projects that use react-app-rewired. It does not support react-scripts@5 or higher without additional compatibility fixes.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Ensure that rewiredEsbuild() is called last in the override chain after any other config modifications.","message":"Options passed to rewiredEsbuild override the entire default configuration; merging with existing override config may be destructive.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Use onlyMinimizer: true for production to avoid CSS processing issues, or handle CSS separately.","message":"Esbuild's CSS support is experimental; CSS imports may behave differently or fail in production builds.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Add 'import React from 'react' at the top of each JSX file, or enable automatic JSX runtime in esbuild options (e.g., loader: 'jsx', jsxFactory: 'React.createElement', jsxFragment: 'React.Fragment').","cause":"esbuild does not automatically inject the React import declaration for JSX files, unlike Babel's classic runtime.","error":"ReferenceError: React is not defined"},{"fix":"Run 'npm i react-app-rewired --save-dev' or 'yarn add react-app-rewired --dev'.","cause":"react-app-rewired is a peer dependency that must be installed separately.","error":"Module not found: Can't resolve 'react-app-rewired'"},{"fix":"Use 'const rewiredEsbuild = require('react-app-rewired-esbuild');' without curly braces.","cause":"Imported the default export incorrectly, e.g., using destructuring with named import.","error":"TypeError: rewiredEsbuild is not a function"},{"fix":"Run 'npm i esbuild-loader --save-dev' or ensure your npm/yarn resolutions include it.","cause":"esbuild-loader is a transitive dependency that was not installed or resolved properly.","error":"Error: Cannot find module 'esbuild-loader'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}