{"id":13493545,"url":"https://github.com/withspectrum/react-app-rewire-styled-components","last_synced_at":"2025-03-28T11:32:55.634Z","repository":{"id":44651073,"uuid":"94617488","full_name":"withspectrum/react-app-rewire-styled-components","owner":"withspectrum","description":"Add the styled-components Babel plugin to your create-react-app app via react-app-rewired","archived":true,"fork":false,"pushed_at":"2022-08-29T05:21:09.000Z","size":72,"stargazers_count":170,"open_issues_count":4,"forks_count":16,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-12T06:17:03.983Z","etag":null,"topics":["create-react-app","create-react-app-styled-components","react-app-rewire","styled-components"],"latest_commit_sha":null,"homepage":null,"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/withspectrum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-17T10:45:49.000Z","updated_at":"2024-12-30T22:00:53.000Z","dependencies_parsed_at":"2022-07-31T01:39:59.445Z","dependency_job_id":null,"html_url":"https://github.com/withspectrum/react-app-rewire-styled-components","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/withspectrum%2Freact-app-rewire-styled-components","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/withspectrum%2Freact-app-rewire-styled-components/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/withspectrum%2Freact-app-rewire-styled-components/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/withspectrum%2Freact-app-rewire-styled-components/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/withspectrum","download_url":"https://codeload.github.com/withspectrum/react-app-rewire-styled-components/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246021507,"owners_count":20710946,"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":["create-react-app","create-react-app-styled-components","react-app-rewire","styled-components"],"created_at":"2024-07-31T19:01:16.379Z","updated_at":"2025-03-28T11:32:55.349Z","avatar_url":"https://github.com/withspectrum.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# `react-app-rewire-styled-components`\n\nAdd the [`babel-plugin-styled-components`](https://github.com/styled-components/babel-plugin-styled-components) to your `create-react-app` app via [`react-app-rewired`](https://github.com/timarney/react-app-rewired).\n\nThis gives you nicer generated class names that include the components' name, minification of styles and many more goodies 💪\n\n## Installation\n\n```sh\nnpm install --save react-app-rewire-styled-components\n# alternatively if you have yarn installed\nyarn add react-app-rewire-styled-components\n```\n\n## Usage\n\nIn the `config-overrides.js` you created for `react-app-rewired` add this code:\n\n```JS\nconst rewireStyledComponents = require('react-app-rewire-styled-components');\n\n/* config-overrides.js */\nmodule.exports = function override(config, env) {\n  config = rewireStyledComponents(config, env);\n  return config;\n}\n```\n\nThat's it, you're now using the `styled-components` Babel plugin!\n\nTo pass options to the Babel plugin use the third argument, it passes straight through to the plugin:\n\n```JS\nconfig = rewireStyledComponents(config, env, {\n  ssr: true,\n})\n```\n\nSee [the available options](https://www.styled-components.com/docs/tooling#babel-plugin) in the `styled-components` documentation.\n\n## License\n\nLicensed under the MIT License, Copyright ©️ 2017 Maximilian Stoiber. See [LICENSE.md](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwithspectrum%2Freact-app-rewire-styled-components","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwithspectrum%2Freact-app-rewire-styled-components","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwithspectrum%2Freact-app-rewire-styled-components/lists"}