{"id":17167048,"url":"https://github.com/mrkou47/jest-css-modules-processor","last_synced_at":"2025-04-13T15:31:11.900Z","repository":{"id":45960964,"uuid":"140421874","full_name":"MrKou47/jest-css-modules-processor","owner":"MrKou47","description":"Implement import css during testing","archived":false,"fork":false,"pushed_at":"2023-05-23T12:54:09.000Z","size":476,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T12:23:20.524Z","etag":null,"topics":["css-modules","jest","jest-plugin"],"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/MrKou47.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}},"created_at":"2018-07-10T11:27:20.000Z","updated_at":"2023-05-23T12:54:12.000Z","dependencies_parsed_at":"2024-06-21T16:34:29.338Z","dependency_job_id":"e6b6fc70-d76d-4ee8-b7b1-dccb66f0d175","html_url":"https://github.com/MrKou47/jest-css-modules-processor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrKou47%2Fjest-css-modules-processor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrKou47%2Fjest-css-modules-processor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrKou47%2Fjest-css-modules-processor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrKou47%2Fjest-css-modules-processor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MrKou47","download_url":"https://codeload.github.com/MrKou47/jest-css-modules-processor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248735505,"owners_count":21153415,"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":["css-modules","jest","jest-plugin"],"created_at":"2024-10-14T23:07:30.881Z","updated_at":"2025-04-13T15:31:11.871Z","avatar_url":"https://github.com/MrKou47.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jest-css-modules-processor\n\nYou can use this module to realize `import` / `require` `.css` file when you run `jest`.\nAnd this module also support `localIdentName`😎!\n\nInspired by [css-modules-require-hook](https://github.com/css-modules/css-modules-require-hook) and [jest-css-modules-transform](https://github.com/Connormiha/jest-css-modules-transform).\n\n## Install\n\n```sh\nyarn add jest-css-modules-processor --dev\n```\n\n## Usage\n\nJust add transform field for your jest config.\n\n```json\n{\n  \"jest\": {\n    \"transform\": {\n        \".+\\\\.(css)$\": \"jest-css-modules-processor\",\n\t\"^.+\\\\.jsx?$\": \"babel-jest\"\n    },\n  }\n}\n```\n\n## Config\n\nYou should add `jestCSSProcessor` field in your `package.json`.\n\n```json\n{\n  \"jestCSSProcessor\": {\n    \"generateScopedName\": \"[name]__[local]___[hash:base64:5]\"\n  }\n}\n```\n\n|option|description|required|\n|-|-|-|\n|camelCase|same as css-loader?cameCase|no|\n|devMode| NODE_ENV === 'development'|no|\n|processCss| process(transformedCSS, filename)|no|\n|processOptions|  http://api.postcss.org/global.html#processOptions|no|\n|createImportedName| https://github.com/css-modules/postcss-modules-extract-imports/blob/master/src/index.js#L73|no|\n|generateScopedName| for example `[name]__[local]___[hash:base64:5]`|no|\n|mode| local or global|no|\n|resolve| resolveOpts|no|\n|rootDir| same as webpack context option|no|\n\nUsually, you just need to set the `generateScopedName` option. And it should same as `localIndentName` value which you setted in the `webpack.config.js`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrkou47%2Fjest-css-modules-processor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrkou47%2Fjest-css-modules-processor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrkou47%2Fjest-css-modules-processor/lists"}