{"id":20614743,"url":"https://github.com/dashed/react-app-rewire-babel-loader","last_synced_at":"2026-03-11T00:32:15.532Z","repository":{"id":65420828,"uuid":"114844029","full_name":"dashed/react-app-rewire-babel-loader","owner":"dashed","description":"Rewire babel-loader loader in your create-react-app project using react-app-rewired.","archived":false,"fork":false,"pushed_at":"2019-02-24T01:04:27.000Z","size":25,"stargazers_count":22,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T17:57:27.374Z","etag":null,"topics":["babel","babel-loader","create-react-app","react-app-rewired","webpack"],"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/dashed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-20T04:49:40.000Z","updated_at":"2024-10-31T22:20:13.000Z","dependencies_parsed_at":"2023-01-22T19:45:15.894Z","dependency_job_id":null,"html_url":"https://github.com/dashed/react-app-rewire-babel-loader","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dashed%2Freact-app-rewire-babel-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dashed%2Freact-app-rewire-babel-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dashed%2Freact-app-rewire-babel-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dashed%2Freact-app-rewire-babel-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dashed","download_url":"https://codeload.github.com/dashed/react-app-rewire-babel-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249027539,"owners_count":21200648,"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":["babel","babel-loader","create-react-app","react-app-rewired","webpack"],"created_at":"2024-11-16T11:13:30.170Z","updated_at":"2026-03-11T00:32:15.508Z","avatar_url":"https://github.com/dashed.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"react-app-rewire-babel-loader [![npm version](https://img.shields.io/npm/v/react-app-rewire-babel-loader.svg?style=flat)](https://www.npmjs.com/package/react-app-rewire-babel-loader)\n=============================\n\n\u003e Rewire [`babel-loader`](https://github.com/babel/babel-loader) loader in your [`create-react-app`](https://github.com/facebookincubator/create-react-app) project using [`react-app-rewired`](https://github.com/timarney/react-app-rewired).\n\nSay there is an awesome library you found on npm that you want to use within your **un-ejected**  [`create-react-app`](https://github.com/facebookincubator/create-react-app) project, but unfortunately, it's published in ES6+ (since `node_modules` doesn't go through `babel-loader`), so you cannot *really* use it.\n\nHowever, with [`react-app-rewired`](https://github.com/timarney/react-app-rewired) and this library, `react-app-rewire-babel-loader`, you can use that awesome library you've found.\n\nSee below for usage.\n\n## 🚨 Not maintained for react-app-rewired v2.x.x+\n\nI'm not maintaining this library for `react-app-rewired` v2.x.x+.\n\nInstead, please consider using: https://github.com/arackaf/customize-cra\n\nThe following essentially emulates `react-app-rewire-babel-loader` which you can copy \u0026 paste into your override config file:\n\n```js\n// NOTE as of customize-cra v0.2.11\n\nconst { babelInclude, getBabelLoader } = require(\"customize-cra\");\n\nconst include = (config, ...includes) =\u003e {\n    return babelInclude(includes)(config);\n};\n\nconst babelExclude = exclude =\u003e config =\u003e {\n  getBabelLoader(config).exclude = exclude;\n  return config;\n};\n\nconst exclude = (config, ...excludes) =\u003e {\n    return babelExclude(excludes)(config);\n};\n```\n\n## Install\n\n\n```sh\n$ yarn add react-app-rewire-babel-loader\n# npm v5+\n$ npm install react-app-rewire-babel-loader\n# before npm v5\n$ npm install --save react-app-rewire-babel-loader\n```\n\n## Usage\n\n```js\n// config-overrides.js\n// see: https://github.com/timarney/react-app-rewired\n\nconst path = require(\"path\");\nconst fs = require(\"fs\");\n\nconst rewireBabelLoader = require(\"react-app-rewire-babel-loader\");\n\n// helpers\n\nconst appDirectory = fs.realpathSync(process.cwd());\nconst resolveApp = relativePath =\u003e path.resolve(appDirectory, relativePath);\n\nmodule.exports = function override(config, env) {\n\n  // white-list some npm modules to the babel-loader pipeline\n  // see: https://webpack.js.org/configuration/module/#rule-include\n\n  config = rewireBabelLoader.include(\n    config,\n    resolveApp(\"node_modules/isemail\")\n  );\n\n  // black-list some modules from the babel-loader pipeline\n  // see: https://webpack.js.org/configuration/module/#rule-exclude\n\n  config = rewireBabelLoader.exclude(\n    config,\n    /(node_modules|bower_components)/\n  );\n\n  return config;\n\n};\n```\n\n\nDevelopment\n===========\n\n- `node.js` and `npm`. See: https://github.com/creationix/nvm#installation\n- `yarn`. See: https://yarnpkg.com/en/docs/install\n- `npm` dependencies. Run: `yarn install`\n\n## Chores\n\n- Lint: `yarn run lint`\n- Prettier: `yarn run pretty`\n- Test: `yarn run test`\n- Pre-publish: `yarn run prepublish`\n- Build: `yarn run build`\n\nLicense\n=======\n\nMIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdashed%2Freact-app-rewire-babel-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdashed%2Freact-app-rewire-babel-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdashed%2Freact-app-rewire-babel-loader/lists"}