{"id":15649534,"url":"https://github.com/a-tokyo/inject-babel-plugins-cra","last_synced_at":"2025-07-29T02:34:56.424Z","repository":{"id":57273970,"uuid":"138974112","full_name":"a-tokyo/inject-babel-plugins-cra","owner":"a-tokyo","description":"🔧 Injects babel plugins into create-react-app without ejecting.","archived":false,"fork":false,"pushed_at":"2018-07-25T17:34:18.000Z","size":54,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-04T18:17:42.741Z","etag":null,"topics":["babel","babel-plugin","create-react-app","create-react-app-babel-plugin","create-react-app-no-eject","create-react-app-rewired","css-modules","relay"],"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/a-tokyo.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":"2018-06-28T06:10:38.000Z","updated_at":"2025-05-02T19:05:19.000Z","dependencies_parsed_at":"2022-09-17T10:12:46.973Z","dependency_job_id":null,"html_url":"https://github.com/a-tokyo/inject-babel-plugins-cra","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/a-tokyo/inject-babel-plugins-cra","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-tokyo%2Finject-babel-plugins-cra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-tokyo%2Finject-babel-plugins-cra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-tokyo%2Finject-babel-plugins-cra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-tokyo%2Finject-babel-plugins-cra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a-tokyo","download_url":"https://codeload.github.com/a-tokyo/inject-babel-plugins-cra/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-tokyo%2Finject-babel-plugins-cra/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267619643,"owners_count":24116604,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-plugin","create-react-app","create-react-app-babel-plugin","create-react-app-no-eject","create-react-app-rewired","css-modules","relay"],"created_at":"2024-10-03T12:30:03.175Z","updated_at":"2025-07-29T02:34:56.399Z","avatar_url":"https://github.com/a-tokyo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# inject-babel-plugins-cra\n🔧 Injects babel plugins into [create-react-app](https://github.com/facebook/create-react-app) without ejecting.\n\n[![npm](https://img.shields.io/npm/v/inject-babel-plugins-cra.svg)](https://www.npmjs.com/package/inject-babel-plugins-cra)\n[![CircleCI](https://img.shields.io/circleci/project/github/RedSparr0w/node-csgo-parser.svg)](https://circleci.com/gh/A-Tokyo/inject-babel-plugins-cra/edit#badges)\n[![npm](https://img.shields.io/npm/l/inject-babel-plugins-cra.svg)](https://github.com/A-Tokyo/inject-babel-plugins-cra/blob/master/LICENSE)\n\n## Getting started\n### Install the module\nRun `yarn add --dev inject-babel-plugins-cra`.\n\n### Usage example\n- add the babel plugins you need to your project. e.g: `yarn add babel-plugin-relay babel-plugin-react-css-modules`.\n- create a js script that injects the plugins to your app, let's call it `init.js`. e.g:\n  ```js\n  const injectBabelPluginCRA = require('inject-babel-plugin-cra');\n  \n  injectBabelPluginCRA([\n    // add a simple plugin\n    { name: 'babel-plugin-relay' },\n    // add a plugin with options\n    {\n      name: 'babel-plugin-react-css-modules',\n      options: {\n        generateScopedName: '[path]__[name]__[local]',\n      },\n    },\n  ]);\n  ```\n- Update your `start` script in `package.json` to call the `init.js` script first.\n  - e.g `\"start\": \"node ./init.js \u0026\u0026 npm-run-all -p watch-css start-js\"`\n\n## Docs\n\n#### params:\n- **plugins**:\n  - description: Plugins to be injected\n  - type: \n     ```js\n     Array\u003c{\n       /* plugin name */\n       name: string,\n       /* plugin options */\n       options?: { [string]: any } \n     }\u003e = []\n     ```\n- **options?**: \n  - description: Optional advanced options object\n  - type:\n    ```js\n    {\n      /* The path to to the babel preset file */\n      babelPresetFilePath?: string,\n      /* The string to match against before injecting the plugins */\n      stringMatcher?: string,\n    } = {\n      /** For older version of CRA*/\n      babelPresetFilePath: './node_modules/babel-preset-react-app/index.js',\n      stringMatcher: 'const plugins = [',\n    }\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-tokyo%2Finject-babel-plugins-cra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa-tokyo%2Finject-babel-plugins-cra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-tokyo%2Finject-babel-plugins-cra/lists"}