{"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.","language":"javascript","status":"abandoned","last_verified":"Sat Apr 25","install":{"commands":["npm install react-app-rewire-babel-loader"],"cli":null},"imports":["const { include } = require('react-app-rewire-babel-loader');","const { exclude } = require('react-app-rewire-babel-loader');","const rewireBabelLoader = require('react-app-rewire-babel-loader');"],"auth":{"required":false,"env_vars":[]},"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.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}