{"id":14976501,"url":"https://github.com/seek-oss/css-modules-typescript-loader","last_synced_at":"2025-04-12T23:39:18.479Z","repository":{"id":56505595,"uuid":"153388433","full_name":"seek-oss/css-modules-typescript-loader","owner":"seek-oss","description":"Webpack loader to create TypeScript declarations for CSS Modules","archived":false,"fork":false,"pushed_at":"2023-10-24T20:00:49.000Z","size":27,"stargazers_count":198,"open_issues_count":23,"forks_count":27,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-12T23:39:13.184Z","etag":null,"topics":["css-modules","front-end","typescript","webpack","webpack-loader"],"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/seek-oss.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-10-17T03:11:30.000Z","updated_at":"2024-01-31T07:32:23.000Z","dependencies_parsed_at":"2024-06-18T12:37:21.322Z","dependency_job_id":"f3f0cb4c-f78e-4440-883c-8840d16082d0","html_url":"https://github.com/seek-oss/css-modules-typescript-loader","commit_stats":{"total_commits":15,"total_committers":12,"mean_commits":1.25,"dds":0.8,"last_synced_commit":"bb4892a5cae169bae8bd0aa1eecdc08e2b2331bf"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seek-oss%2Fcss-modules-typescript-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seek-oss%2Fcss-modules-typescript-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seek-oss%2Fcss-modules-typescript-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seek-oss%2Fcss-modules-typescript-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seek-oss","download_url":"https://codeload.github.com/seek-oss/css-modules-typescript-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647255,"owners_count":21139081,"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","front-end","typescript","webpack","webpack-loader"],"created_at":"2024-09-24T13:53:59.287Z","updated_at":"2025-04-12T23:39:18.451Z","avatar_url":"https://github.com/seek-oss.png","language":"JavaScript","readme":"[![Build Status](https://img.shields.io/travis/seek-oss/css-modules-typescript-loader/master.svg?style=flat-square)](http://travis-ci.org/seek-oss/css-modules-typescript-loader) [![npm](https://img.shields.io/npm/v/css-modules-typescript-loader.svg?style=flat-square)](https://www.npmjs.com/package/css-modules-typescript-loader) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square)](http://commitizen.github.io/cz-cli/)\n\n# css-modules-typescript-loader\n\n[Webpack](https://webpack.js.org/) loader to create [TypeScript](https://www.typescriptlang.org/) declarations for [CSS Modules](https://github.com/css-modules/css-modules).\n\nEmits TypeScript declaration files matching your CSS Modules in the same location as your source files, e.g. `src/Component.css` will generate `src/Component.css.d.ts`.\n\n## Why?\n\nThere are currently a lot of [solutions to this problem](https://www.npmjs.com/search?q=css%20modules%20typescript%20loader). However, this package differs in the following ways:\n\n- Encourages generated TypeScript declarations to be checked into source control, which allows `webpack` and `tsc` commands to be run in parallel in CI.\n\n- Ensures committed TypeScript declarations are in sync with the code that generated them via the [`verify` mode](#verify-mode).\n\n## Usage\n\nPlace `css-modules-typescript-loader` directly after `css-loader` in your webpack config.\n\n```js\nmodule.exports = {\n  module: {\n    rules: [\n      {\n        test: /\\.css$/,\n        use: [\n          'css-modules-typescript-loader',\n          {\n            loader: 'css-loader',\n            options: {\n              modules: true\n            }\n          }\n        ]\n      }\n    ]\n  }\n};\n```\n\n### Verify Mode\n\nSince the TypeScript declarations are generated by `webpack`, they may potentially be out of date by the time you run `tsc`. To ensure your types are up to date, you can run the loader in `verify` mode, which is particularly useful in CI.\n\nFor example:\n\n```js\n{\n  loader: 'css-modules-typescript-loader',\n  options: {\n    mode: process.env.CI ? 'verify' : 'emit'\n  }\n}\n```\n\nInstead of emitting new TypeScript declarations, this will throw an error if a generated declaration doesn't match the committed one. This allows `tsc` and `webpack` to run in parallel in CI, if desired.\n\nThis workflow is similar to using the [Prettier](https://github.com/prettier/prettier) [`--list-different` option](https://prettier.io/docs/en/cli.html#list-different).\n\n## With Thanks\n\nThis package borrows heavily from [typings-for-css-modules-loader](https://github.com/Jimdo/typings-for-css-modules-loader).\n\n## License\n\nMIT.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseek-oss%2Fcss-modules-typescript-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseek-oss%2Fcss-modules-typescript-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseek-oss%2Fcss-modules-typescript-loader/lists"}