{"id":22038552,"url":"https://github.com/crazyurus/craco-css-modules","last_synced_at":"2026-03-07T08:02:32.540Z","repository":{"id":70169911,"uuid":"452176827","full_name":"crazyurus/craco-css-modules","owner":"crazyurus","description":"A craco plugin to automatically use css modules","archived":false,"fork":false,"pushed_at":"2024-09-13T08:56:13.000Z","size":240,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-22T01:41:29.708Z","etag":null,"topics":["craco","create-react-app","css-modules"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/craco-css-modules","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/crazyurus.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-01-26T07:17:52.000Z","updated_at":"2024-09-13T08:56:16.000Z","dependencies_parsed_at":"2025-05-07T21:44:18.787Z","dependency_job_id":null,"html_url":"https://github.com/crazyurus/craco-css-modules","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/crazyurus/craco-css-modules","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazyurus%2Fcraco-css-modules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazyurus%2Fcraco-css-modules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazyurus%2Fcraco-css-modules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazyurus%2Fcraco-css-modules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crazyurus","download_url":"https://codeload.github.com/crazyurus/craco-css-modules/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazyurus%2Fcraco-css-modules/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30209796,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T05:23:27.321Z","status":"ssl_error","status_checked_at":"2026-03-07T05:00:17.256Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["craco","create-react-app","css-modules"],"created_at":"2024-11-30T11:06:38.609Z","updated_at":"2026-03-07T08:02:32.496Z","avatar_url":"https://github.com/crazyurus.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Craco CSS Modules Plugin\n\n![test](https://github.com/crazyurus/craco-css-modules/actions/workflows/test.yaml/badge.svg)\n![publish](https://github.com/crazyurus/craco-css-modules/actions/workflows/publish.yaml/badge.svg)\n[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n[![npm](https://badgen.net/npm/v/craco-css-modules)](https://www.npmjs.com/package/craco-css-modules)\n[![npm dependents](https://badgen.net/npm/dependents/craco-css-modules)](https://www.npmjs.com/package/craco-css-modules?activeTab=dependents)\n[![npm downloads](https://badgen.net/npm/dt/craco-css-modules)](https://www.npmjs.com/package/craco-css-modules)\n\nThis is a [craco](https://craco.js.org) plugin that adds CSS Modules support to [create-react-app](https://facebook.github.io/create-react-app/).\n\n## Introduction\n\nWhen you use `craco-css-modules`, you no longer need to add the module suffix to `css` `less` or `scss` file names. For example:\n```js\n// Before\nimport styles from './index.module.scss';\n\n// After\nimport styles from './index.scss';\n```\n\nWe judge whether we should use CSS Modules based on how the less file is imported.\n\n```js\n// use CSS Modules\nimport styles from './index.scss';\n\n// do not use CSS Modules\nimport './index.scss';\n```\n\n## Supported Versions\n\n`craco-css-modules` is tested with:\n\n- **react-scripts**: `^5.0.0`\n- **@craco/craco**: `6.4.0` and above, `7.0.0`\n\nAnd you can also use with follow plugins:\n\n- **craco-less**: `^3.0.0`\n\n## Installation\n\nFirst, follow the [`craco` Installation Instructions](https://github.com/dilanx/craco/blob/master/packages/craco/README.md) to install the `craco` package, create a `craco.config.js` file, and modify the scripts in your `package.json`.\n\nThen install `craco-css-modules`:\n\n```bash\n$ npm install --dev craco-css-modules\n\n# OR\n\n$ yarn add --dev craco-css-modules\n\n# OR\n\n$ pnpm install --dev craco-css-modules\n```\n\n## Usage\n\nHere is a complete `craco.config.js` configuration file that adds CSS Modules rule to `create-react-app`:\n\n```js\nconst CracoCSSModules = require('craco-css-modules');\n\nmodule.exports = {\n  plugins: [\n    { plugin: CracoCSSModules }\n  ],\n};\n```\n\nIf you are using `less`, you can also use the plugin `craco-less`:\n\n```js\nconst CracoLess = require('craco-less');\nconst CracoCSSModules = require('craco-css-modules');\n\nmodule.exports = {\n  plugins: [\n    { plugin: CracoLess },\n    { plugin: CracoCSSModules }\n  ],\n};\n```\n\n## Example\n\nHere is a complete example [create-react-app-with-craco](https://github.com/crazyurus/create-react-app). You can directly use this template.\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazyurus%2Fcraco-css-modules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrazyurus%2Fcraco-css-modules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazyurus%2Fcraco-css-modules/lists"}