{"id":20491,"library":"react-app-rewire-babel-loader","title":"react-app-rewire-babel-loader","description":"A utility for use with react-app-rewired to allow customization of the babel-loader configuration in create-react-app projects without ejecting. Current stable version is 0.1.1, released with no further updates. It provides two functions, include and exclude, to add or remove npm modules from the babel-loader pipeline. This is a niche tool for developers who need to transpile specific node_modules packages that are not ES5, which create-react-app's default configuration excludes. No known alternatives for this specific purpose.","status":"abandoned","version":"0.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/dashed/react-app-rewire-babel-loader","tags":["javascript","babel-loader","react-app-rewired","webpack","create-react-app"],"install":[{"cmd":"npm install react-app-rewire-babel-loader","lang":"bash","label":"npm"},{"cmd":"yarn add react-app-rewire-babel-loader","lang":"bash","label":"yarn"},{"cmd":"pnpm add react-app-rewire-babel-loader","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required to override create-react-app's webpack configuration.","package":"react-app-rewired","optional":false},{"reason":"The webpack loader being rewireed; must be present in the project.","package":"babel-loader","optional":false}],"imports":[{"note":"This package does not support ES module imports. Use CommonJS require.","wrong":"import { include } from 'react-app-rewire-babel-loader';","symbol":"include","correct":"const { include } = require('react-app-rewire-babel-loader');"},{"note":"Both functions are exported from the main entry; no subpath exports.","wrong":"const exclude = require('react-app-rewire-babel-loader/exclude');","symbol":"exclude","correct":"const { exclude } = require('react-app-rewire-babel-loader');"},{"note":"Default export is an object with include and exclude methods.","wrong":"import rewireBabelLoader from 'react-app-rewire-babel-loader';","symbol":"default","correct":"const rewireBabelLoader = require('react-app-rewire-babel-loader');"}],"quickstart":{"code":"// config-overrides.js\nconst path = require('path');\nconst fs = require('fs');\nconst rewireBabelLoader = require('react-app-rewire-babel-loader');\n\nconst appDirectory = fs.realpathSync(process.cwd());\nconst resolveApp = relativePath => path.resolve(appDirectory, relativePath);\n\nmodule.exports = function override(config, env) {\n  // Include a specific npm module in babel transpilation\n  config = rewireBabelLoader.include(\n    config,\n    resolveApp('node_modules/some-es6-package')\n  );\n  // Exclude node_modules from babel (default CRA behavior)\n  config = rewireBabelLoader.exclude(\n    config,\n    /(node_modules|bower_components)/\n  );\n  return config;\n};","lang":"javascript","description":"Shows how to use include and exclude to customize babel-loader in CRA without ejecting."},"warnings":[{"fix":"Ensure react-app-rewired is installed and config-overrides.js is set up correctly.","message":"Requires react-app-rewired to be installed and configured. Without it, this package does nothing.","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"Consider using craco or ejecting to customize webpack.","message":"Package is no longer maintained and may not work with latest create-react-app versions.","severity":"deprecated","affected_versions":">=0.1.0"},{"fix":"Use path.resolve to get absolute path, e.g., path.resolve('node_modules/package').","message":"The include path must be an absolute path to the npm module's directory; relative paths will fail.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run: npm install react-app-rewire-babel-loader --save-dev","cause":"The package is not installed or is not in the correct location.","error":"Module not found: Can't resolve 'react-app-rewire-babel-loader'"},{"fix":"Change to: const rewireBabelLoader = require('react-app-rewire-babel-loader');","cause":"Using ES module import syntax with this CommonJS-only package.","error":"TypeError: rewireBabelLoader.include is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}