{"id":13433900,"url":"https://github.com/arackaf/customize-cra","last_synced_at":"2025-05-13T23:03:59.009Z","repository":{"id":38863515,"uuid":"150754366","full_name":"arackaf/customize-cra","owner":"arackaf","description":"Override webpack configurations for create-react-app 2.0","archived":false,"fork":false,"pushed_at":"2023-10-06T20:33:24.000Z","size":691,"stargazers_count":2794,"open_issues_count":115,"forks_count":266,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-04-30T10:36:21.117Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arackaf.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":"contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-28T14:42:33.000Z","updated_at":"2025-04-29T03:29:08.000Z","dependencies_parsed_at":"2024-06-18T11:18:01.011Z","dependency_job_id":null,"html_url":"https://github.com/arackaf/customize-cra","commit_stats":{"total_commits":132,"total_committers":40,"mean_commits":3.3,"dds":0.6666666666666667,"last_synced_commit":"7e97127e530cc6827af66061525e29925e347670"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arackaf%2Fcustomize-cra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arackaf%2Fcustomize-cra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arackaf%2Fcustomize-cra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arackaf%2Fcustomize-cra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arackaf","download_url":"https://codeload.github.com/arackaf/customize-cra/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254040380,"owners_count":22004525,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T02:01:39.804Z","updated_at":"2025-05-13T23:03:58.983Z","avatar_url":"https://github.com/arackaf.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# `customize-cra`\n\n[![All Contributors](https://img.shields.io/badge/all_contributors-17-orange.svg?style=flat-square)](#contributors-)\n\n📌📌 **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).\n\nThis 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.\n\n- [How to install](#how-to-install)\n- [Warning](#warning)\n- [Overview](#overview)\n- [Usage](#usage)\n  - [With `webpack`](#with-webpack)\n  - [With `webpack-dev-server`](#with-webpack-dev-server)\n  - [With `MobX`](#with-mobx)\n- [Documentation](#documentation)\n- [Contributing](#contributing)\n- [Contributors](#contributors)\n\n## How to install\n\nThis 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.\n\n```bash\nyarn add customize-cra react-app-rewired --dev\n```\n\n## ❗ Warning\n\n\u003e \"Stuff can break\"\n\u003e \\- Dan Abramov\n\nUsing this library will override the default behavior and configuration of `create-react-app`, therefore invalidating the guarantees that come with it. Use with discretion!\n\n## Overview\n\n`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`.\n\n## Usage\n\n**Note:** all code should be added to `config-overrides.js` at the same level as `package.json`.\n\nSee the [api docs](api.md) for documentation for each function.\n\n### With `webpack`\n\nTo 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.\n\nFor example:\n\n```js\nconst {\n  override,\n  addDecoratorsLegacy,\n  disableEsLint,\n  addBundleVisualizer,\n  addWebpackAlias,\n  adjustWorkbox\n} = require(\"customize-cra\");\nconst path = require(\"path\");\n\nmodule.exports = override(\n  // enable legacy decorators babel plugin\n  addDecoratorsLegacy(),\n\n  // disable eslint in webpack\n  disableEsLint(),\n\n  // add webpack bundle visualizer if BUNDLE_VISUALIZE flag is enabled\n  process.env.BUNDLE_VISUALIZE == 1 \u0026\u0026 addBundleVisualizer(),\n\n  // add an alias for \"ag-grid-react\" imports\n  addWebpackAlias({\n    [\"ag-grid-react$\"]: path.resolve(__dirname, \"src/shared/agGridWrapper.js\")\n  }),\n\n  // adjust the underlying workbox\n  adjustWorkbox(wb =\u003e\n    Object.assign(wb, {\n      skipWaiting: true,\n      exclude: (wb.exclude || []).concat(\"index.html\")\n    })\n  )\n);\n```\n\n### With `webpack-dev-server`\n\nYou can use the `overrideDevServer` function to override the `webpack-dev-server` config. It works the same way as `override`:\n\n```js\nconst {\n  override,\n  disableEsLint,\n  overrideDevServer,\n  watchAll\n} = require(\"customize-cra\");\n\nmodule.exports = {\n  webpack: override(\n    // usual webpack plugin\n    disableEsLint()\n  ),\n  devServer: overrideDevServer(\n    // dev server plugin\n    watchAll()\n  )\n};\n```\n\n### With `MobX`\n\nIf you want CRA 2 to work with MobX, use the `addDecoratorsLegacy` and `disableEsLint`.\n\n## Documentation\n\n[See `api.md`](api.md) for documentation on the functions provided by `customize-cra`.\n\n## Contributing\n\nFor 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).\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/dqu\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/4287468?v=4\" width=\"100px;\" alt=\"dqu\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003edqu\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#question-dqu\" title=\"Answering Questions\"\u003e💬\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://blog.breezelin.cn\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/5266711?v=4\" width=\"100px;\" alt=\"Breeze\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eBreeze\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/arackaf/customize-cra/commits?author=breeze2\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/Terryand\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/22273687?v=4\" width=\"100px;\" alt=\"Terryand\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eTerryand\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/arackaf/customize-cra/commits?author=Terryand\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/m-weeks\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/37918120?v=4\" width=\"100px;\" alt=\"m-weeks\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003em-weeks\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/arackaf/customize-cra/issues?q=author%3Am-weeks\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/wuchaoya\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/20284675?v=4\" width=\"100px;\" alt=\"吴超\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003e吴超\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#example-wuchaoya\" title=\"Examples\"\u003e💡\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://jamesthistlewood.co.uk\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/8274049?v=4\" width=\"100px;\" alt=\"James Thistlewood\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJames Thistlewood\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/arackaf/customize-cra/commits?author=jthistle\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/taddj\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/48697700?v=4\" width=\"100px;\" alt=\"taddj\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003etaddj\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#question-taddj\" title=\"Answering Questions\"\u003e💬\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/postgetme\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/5118867?v=4\" width=\"100px;\" alt=\"MeiLin\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMeiLin\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/arackaf/customize-cra/commits?author=postgetme\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/badgerwithagun\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/6483013?v=4\" width=\"100px;\" alt=\"Graham Crockford\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eGraham Crockford\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#ideas-badgerwithagun\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/gfafei\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/12234890?v=4\" width=\"100px;\" alt=\"afei\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eafei\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/arackaf/customize-cra/commits?author=gfafei\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/fireairforce\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/32598811?v=4\" width=\"100px;\" alt=\"zoomdong\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003ezoomdong\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/arackaf/customize-cra/commits?author=fireairforce\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/danilofuchs\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/17657014?v=4\" width=\"100px;\" alt=\"Danilo Campana Fuchs\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDanilo Campana Fuchs\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/arackaf/customize-cra/commits?author=danilofuchs\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/ronarvaez\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/14306638?v=4\" width=\"100px;\" alt=\"Rodrigo Narvaez\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eRodrigo Narvaez\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/arackaf/customize-cra/commits?author=ronarvaez\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://blackmatch.github.io\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/12443954?v=4\" width=\"100px;\" alt=\"blackmatch\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eblackmatch\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/arackaf/customize-cra/commits?author=blackmatch\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/billypon\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/1763302?v=4\" width=\"100px;\" alt=\"billypon\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003ebillypon\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/arackaf/customize-cra/commits?author=billypon\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/1123612483\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/20741541?v=4\" width=\"100px;\" alt=\"Juetta\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJuetta\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/arackaf/customize-cra/commits?author=1123612483\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://www.onlyling.com\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/9999765?v=4\" width=\"100px;\" alt=\"LING_ZI_QING\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eLING_ZI_QING\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/arackaf/customize-cra/commits?author=onlyling\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/arackaf/customize-cra/commits?author=onlyling\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-enable --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farackaf%2Fcustomize-cra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farackaf%2Fcustomize-cra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farackaf%2Fcustomize-cra/lists"}