{"id":14990608,"url":"https://github.com/moxystudio/react-app-rewire-css-modules-extensionless","last_synced_at":"2025-07-03T23:33:31.145Z","repository":{"id":65994589,"uuid":"141485204","full_name":"moxystudio/react-app-rewire-css-modules-extensionless","owner":"moxystudio","description":"Enables CSS modules without any special extension for CRA apps using react-app-rewired","archived":false,"fork":false,"pushed_at":"2020-01-03T10:08:51.000Z","size":655,"stargazers_count":5,"open_issues_count":0,"forks_count":4,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-16T10:48:03.360Z","etag":null,"topics":["create-react-app","cssmodules","react-app-rewire","reactjs"],"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/moxystudio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-18T20:13:44.000Z","updated_at":"2020-07-12T08:18:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"f2f58462-fe03-4196-81d0-6c3ea2a82a58","html_url":"https://github.com/moxystudio/react-app-rewire-css-modules-extensionless","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/moxystudio/react-app-rewire-css-modules-extensionless","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moxystudio%2Freact-app-rewire-css-modules-extensionless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moxystudio%2Freact-app-rewire-css-modules-extensionless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moxystudio%2Freact-app-rewire-css-modules-extensionless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moxystudio%2Freact-app-rewire-css-modules-extensionless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moxystudio","download_url":"https://codeload.github.com/moxystudio/react-app-rewire-css-modules-extensionless/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moxystudio%2Freact-app-rewire-css-modules-extensionless/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260713325,"owners_count":23050824,"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","cssmodules","react-app-rewire","reactjs"],"created_at":"2024-09-24T14:20:27.017Z","updated_at":"2025-07-03T23:33:31.054Z","avatar_url":"https://github.com/moxystudio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-app-rewire-css-modules-extensionless\n\n[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][codecov-image]][codecov-url] [![Dependency status][david-dm-image]][david-dm-url] [![Dev Dependency status][david-dm-dev-image]][david-dm-dev-url]\n\n[npm-url]:https://npmjs.org/package/react-app-rewire-css-modules-extensionless\n[npm-image]:https://img.shields.io/npm/v/react-app-rewire-css-modules-extensionless.svg\n[downloads-image]:https://img.shields.io/npm/dm/react-app-rewire-css-modules-extensionless.svg\n[travis-url]:https://travis-ci.org/moxystudio/react-app-rewire-css-modules-extensionless\n[travis-image]:https://img.shields.io/travis/moxystudio/react-app-rewire-css-modules-extensionless/master.svg\n[codecov-url]:https://codecov.io/gh/moxystudio/react-app-rewire-css-modules-extensionless\n[codecov-image]:https://img.shields.io/codecov/c/github/moxystudio/react-app-rewire-css-modules-extensionless/master.svg\n[david-dm-url]:https://david-dm.org/moxystudio/react-app-rewire-css-modules-extensionless\n[david-dm-image]:https://img.shields.io/david/moxystudio/react-app-rewire-css-modules-extensionless.svg\n[david-dm-dev-url]:https://david-dm.org/moxystudio/react-app-rewire-css-modules-extensionless?type=dev\n[david-dm-dev-image]:https://img.shields.io/david/dev/moxystudio/react-app-rewire-css-modules-extensionless.svg\n\nAdds CSS modules for CRA apps without requiring the `.modules.css` extension, using [`react-app-rewired`](https://github.com/timarney/react-app-rewired).\n\nThis rewire is similar to [`react-app-rewire-css-modules`](https://github.com/codebandits/react-app-rewire-css-modules) with two differences:\n\n- Doesn't require `.modules.css` extension for CSS files in `src/` the source folder.\n- Doesn't force you to install and use the `sass-loader`\n- Setups jest\n\n\n## Installation\n\n```sh\n$ npm install --save-dev react-app-rewire-css-modules-extensionless\n```\n\n\n## Usage\n\nIn the `config-overrides.js` you created for `react-app-rewired` add this code:\n\n```js\nmodule.exports = {\n    webpack: (config, env) =\u003e {\n        config = require('react-app-rewire-css-modules-extensionless').webpack(config, env, { /* options */ });\n        // The line below is equivalent\n        // config = require('react-app-rewire-css-modules-extensionless')(config, env, { /* options */ });\n\n        // You may apply other rewires as well\n\n        return config;\n    },\n    jest: (config) =\u003e {\n        config = require('react-app-rewire-css-modules-extensionless').jest(config);\n\n        // You may apply other rewires as well\n\n        return config;\n    },\n};\n```\n\nIf you are using the `compose` utility of `react-app-rewired`:\n\n```js\nconst { compose } = require('react-app-rewired');\n\nmodule.exports = {\n    webpack: compose(\n        require('react-app-rewire-css-modules-extensionless').webpack({ /* options */ })\n        // The line below is equivalent\n        require('react-app-rewire-css-modules-extensionless')({ /* options */ })\n        // ... other rewires\n    ),\n    jest: compose(\n        require('react-app-rewire-css-modules-extensionless').jest()\n        // ... other rewires\n    ),\n};\n```\n\nAvailable options:\n\n| Name   | Description   | Type     | Default |\n| ------ | ------------- | -------- | ------- |\n| test | The loader test pattern | string/RegExp | `/\\.css$/` |\n| include | The loader include condition | string/Array/RegExp/Function | *src folder* |\n| exclude | The loader exclude condition | string/Array/RegExp/Function | |\n| localIdentName | The localIdentName option to pass to the `css-loader` | string | `[hash:base64:5]!` for production, `[name]__[local]___[hash:base64:5]!` otherwise |\n\nIf you modify `include` and `exclude` to point to packages in `node_modules`, it's advised to use `fs.realpathSync` so that it plays well with packages linked with `npm link`. Alternatively, you may disable [`resolve.symlinks`](https://webpack.js.org/configuration/resolve/#resolve-symlinks) in your webpack configuration.\n\n\n## Tests\n\n```sh\n$ npm test\n$ npm test -- --watch # during development\n```\n\n\n## License\n\n[MIT License](http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoxystudio%2Freact-app-rewire-css-modules-extensionless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoxystudio%2Freact-app-rewire-css-modules-extensionless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoxystudio%2Freact-app-rewire-css-modules-extensionless/lists"}