{"id":19778244,"url":"https://github.com/a-x-/babel-plugin-transform-import-css","last_synced_at":"2025-10-10T00:46:42.292Z","repository":{"id":48034515,"uuid":"123445377","full_name":"a-x-/babel-plugin-transform-import-css","owner":"a-x-","description":"Pack css-modules css into js (for library building purposes)","archived":false,"fork":false,"pushed_at":"2021-08-10T17:43:31.000Z","size":158,"stargazers_count":10,"open_issues_count":8,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-10T00:46:38.110Z","etag":null,"topics":["babel","babel-plugin","babel7","css-modules","frontend","postcss","rocketbank"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/babel-plugin-transform-import-css","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/a-x-.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-01T14:25:55.000Z","updated_at":"2021-09-13T19:17:33.000Z","dependencies_parsed_at":"2022-08-12T17:10:59.633Z","dependency_job_id":null,"html_url":"https://github.com/a-x-/babel-plugin-transform-import-css","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/a-x-/babel-plugin-transform-import-css","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-x-%2Fbabel-plugin-transform-import-css","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-x-%2Fbabel-plugin-transform-import-css/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-x-%2Fbabel-plugin-transform-import-css/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-x-%2Fbabel-plugin-transform-import-css/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a-x-","download_url":"https://codeload.github.com/a-x-/babel-plugin-transform-import-css/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-x-%2Fbabel-plugin-transform-import-css/sbom","scorecard":{"id":157937,"data":{"date":"2025-08-11","repo":{"name":"github.com/a-x-/babel-plugin-transform-import-css","commit":"86641b6f7e6837bad6f0de55948a1cb8b1474526"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 2/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 3 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"19 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-566m-qj78-rww5","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-hwj9-h5mp-3pm3","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-662x-fhqg-9p8v","Warn: Project is vulnerable to: GHSA-394c-5j6w-4xmx","Warn: Project is vulnerable to: GHSA-78cj-fxph-m83p","Warn: Project is vulnerable to: GHSA-fhg7-m89q-25r3"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T12:24:35.834Z","repository_id":48034515,"created_at":"2025-08-16T12:24:35.834Z","updated_at":"2025-08-16T12:24:35.834Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002344,"owners_count":26083356,"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-10-09T02:00:07.460Z","response_time":59,"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","babel7","css-modules","frontend","postcss","rocketbank"],"created_at":"2024-11-12T05:28:36.726Z","updated_at":"2025-10-10T00:46:42.256Z","avatar_url":"https://github.com/a-x-.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# So Alpha. Current version is unstable 1.0.0-alpha with babel@7 and postcss@7 support! Use stable [0.x.x] version for babel@6 and  postcss@6\n\nInjects class map imported from css-modules into js.\n\nPlugin respects webpack css-modules API and postcss config.\n\n# Requirements\n- babel == 7, postcss == 7, node \u003e= 8.\n  \u003cbr/\u003e**Note**. For babel@6 use previous version of plugin: [0.x.x]\n- babel and postcss configs for best results\n\n[0.x.x]: https://github.com/a-x-/babel-plugin-transform-import-css/tree/backports\n\n# Installation \u0026 configuration\n```sh\nnpm add -SD babel-plugin-transform-import-css\n```\n\n**.babelrc** example:\n```json5\n{\n  \"sourceMaps\": \"inline\",\n  \"presets\": [\n    \"@babel/env\",\n    \"react\"\n  ],\n  \"plugins\": [\n    [\"transform-import-css\", {\n      \"generateScopedName\": \"lib-[name]-[local]-[hash:base64:4]\"\n    }]\n  ]\n}\n```\n\nEvery js file that has a statement such as:\n\n```js\nimport classes from './Component.css'\n// ... some code\n```\n\nwill be transpiled to:\n\n```js\nvar classes = {\n    root: 'lib-foo-root-SFs0',\n    // ... some classes ...\n}\nrequire('load-styles')('.root{color:red}; ...some css...') // puts styles into the head\n// ... some code\n```\n\n# Api\n- `generateScopedName` — css-modules scope template. **Default**: `[name]__[local]___[hash:base64:5]`\n- `configPath` — postcss config path. **Default**: _auto detect_\n- `ext` — postcss files' extension. Typical use: `ext: '.pcss'`. **Default**: `'.css'`\n\n**Note**. Plugin rely on some @babel/ peerDependencies, that are typically included in your project by @babel/core self.\n\n# Use Cases\n\nBundling the css with npm packed library of js/react components.\nIt is good for portability.\n\n# TODO\n- [x] babel@7\n- [x] `configPath` and `ext` options\n- [ ] Compatibility with mini-css-extract-plugin and extract-text-webpack-plugin.\n  babel-plugin-transform-import-css should skip `require('load-styles')(css)` inserting in that cases.\n- [ ] Support postcss configs in package.json\n- [ ] More flexible postcss config loader.\n  (asynchronous `postcss-load-config` lib can't be used due to synchronous nature of the babel).\n\n# Alternatives\n- [babel-plugin-react-css-modules](https://github.com/gajus/babel-plugin-react-css-modules)\n  - adds custom syntax\n  - react specific\n  - it isn't `export { classes }` friendly\n- [babel-plugin-import-css-to-jss](https://github.com/websecurify/babel-plugin-import-css-to-jss)\n  - breaks css-modules api (`import jssObject from './style.css'`)\n- [babel-plugin-css-modules-transform](https://github.com/michalkvasnicak/babel-plugin-css-modules-transform)\n  - genarates classes hash-map too\n  - cannot bundle css-modules in js\n\n\n----\n\n# Sponsored with ❤️ by \u003ca href=\"https://rocketbank.ru\"\u003eRocketBank\u003c/a\u003e \u003cimg src=\"https://user-images.githubusercontent.com/6201068/41535008-57abc544-7309-11e8-9259-4b38bc1e7370.png\" width=\"24\"/\u003e\nRussian Fintech startup\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-x-%2Fbabel-plugin-transform-import-css","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa-x-%2Fbabel-plugin-transform-import-css","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-x-%2Fbabel-plugin-transform-import-css/lists"}