$ show timarney/react-app-rewired
react-app-rewired is a CLI tool that allows users to override Create React App (CRA) webpack, Jest, and dev server configurations without ejecting. It works by intercepting react-scripts commands (start, build, test) through a drop-in replacement bin script. The tool loads a user-defined config-overrides.js, then monkey-patches the original CRA configuration modules in Node's require.cache before executing the real react-scripts scripts. This approach is fragile, relies on internal CRA module paths, and is tied to CRA 2.x (react-scripts ^2.1.3). The codebase is simple and functional but lacks its own test suite, uses outdated peer dependencies, and the pattern of monkey-patching is not recommended for modern development. The project is effectively in maintenance mode with the community recommending alternatives like craco or rescripts.
The LLM identified 2 files worth highlighting for reuse:
Normalizes the user's config-overrides.js export, supporting both a single override function or an object with webpack, jest, devServer, and paths fields. This pattern allows flexible customization while keeping a consistent API, and can be extracted as a general configuration loader for tools that need multiple override points.
Provides dependRequire and dependRequireResolve to require modules relative to a specific base path (the react-scripts version). This is a clean utility for resolving dependencies in an isolated context, reusable in any project that needs to dynamically require modules from a controlled dependency path.