Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

customize-cra

> 编程语言
Open source

Override webpack configurations for create-react-app 2.0

2.8K stars0 likes0 views
WebsiteGitHub

About

Override webpack configurations for create-react-app 2.0

# `customize-cra` **Breaking change:** With the `1.0` release of customize-cra breaking changes have been made to the `addLessLoader` customizer to support the changes to `create-react-app` in [#7876](https://github.com/facebook/create-react-app/pull/7876). Please follow the migration guide in [#253](https://github.com/arackaf/customize-cra/issues/253). This project provides a set of utilities to customize [`create-react-app`](https://github.com/facebook/create-react-app) versions 2 and 3 configurations leveraging [`react-app-rewired`](https://github.com/timarney/react-app-rewired/) core functionalities. - [How to install](#how-to-install) - [Warning](#warning) - [Overview](#overview) - [Usage](#usage) - [With `webpack`](#with-webpack) - [With `webpack-dev-server`](#with-webpack-dev-server) - [With `MobX`](#with-mobx) - [Documentation](#documentation) - [Contributing](#contributing) - [Contributors](#contributors) ## How to install This project relies on [`react-app-rewired`](https://github.com/timarney/react-app-rewired/). You'll need to install that in order for `customize-cra` to work. ```bash yarn add customize-cra react-app-rewired --dev ``` ## ❗ Warning > "Stuff can break" > \- Dan Abramov Using this library will override the default behavior and configuration of `create-react-app`, therefore invalidating the guarantees that come with it. Use with discretion! ## Overview `customize-cra` takes advantage of `react-app-rewired`'s `config-overrides.js` file. By importing `customize-cra` functions and exporting a few function calls wrapped in our `override` function, you can easily modify the underlying config objects (`webpack`, `webpack-dev-server`, `babel`, etc.) that make up `create-react-app`. ## Usage **Note:** all code should be added to `config-overrides.js` at the same level as `package.json`. See the [api docs](api.md) for documentation for each function. ### With `webpack` To use these plugins, import the `override` function, and call it with whatever plugins you need. Each of these plugin invocations will return a new function, that `override` will call with the newly modified config object. Falsy values will be ignored though, so if you need to conditionally apply any of these plugins, you can do so like below. For example: ``` … ``` ### With `webpack-dev-server` You can use the `overrideDevServer` function to override the `webpack-dev-server` config. It works the same way as `override`: ```js const { override, disableEsLint, overrideDevServer, watchAll } = require("customize-cra"); module.exports = { webpack: override( // usual webpack plugin disableEsLint() ), devServer: overrideDevServer( // dev server plugin watchAll() ) }; ``` ### With `MobX` If you want CRA 2 to work with MobX, use the `addDecoratorsLegacy` and `disableEsLint`. ## Documentation [See `api.md`](api.md) for documentation on the functions provided by `customize-cra`. ## Contributing For more information about contributing to this project, like a directory map or a how-to for reporting an issue about the project, please [`see contributing.md`](contributing.md). ## Contributors ✨ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
dqu


Breeze


Terryand


m-weeks


吴超


James Thistlewood


taddj


MeiLin


Graham Crockford


afei


zoomdong


Danilo Campana Fuchs


Rodrigo Narvaez


blackmatch


billypon


Juetta


LING_ZI_QING

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

GitHub Issues· 0 open

View all on GitHub

No open issues yet, or sync has not completed.

Highlights

  • •How to install
  • •Overview
  • •With webpack
  • •With webpack-dev-server
  • •With MobX
  • •Documentation
  • •Contributing
  • •Contributors

> Tags

JavaScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言