Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dmitrijs-balcers/parcel-transformer-ts-css-modules
Bridge ts with your css-modules
https://github.com/dmitrijs-balcers/parcel-transformer-ts-css-modules
css css-modules javascript typescript
Last synced: 3 months ago
JSON representation
Bridge ts with your css-modules
- Host: GitHub
- URL: https://github.com/dmitrijs-balcers/parcel-transformer-ts-css-modules
- Owner: dmitrijs-balcers
- License: mit
- Created: 2021-08-29T09:26:47.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-03-06T07:56:31.000Z (almost 3 years ago)
- Last Synced: 2024-10-01T03:07:45.720Z (3 months ago)
- Topics: css, css-modules, javascript, typescript
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/parcel-transformer-ts-css-modules
- Size: 36.1 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# parcel-transformer-ts-css-modules
_Bridge ts with your css-modules_This transformer is going to create `.d.ts` according to your `.module.css` files using [typed-css-modules](https://www.npmjs.com/package/typed-css-modules)
,
so that you can reference your css in ts files without type errors.## Installation
`npm i -D parcel-transformer-ts-css-modules`
or
`yarn add -D parcel-transformer-ts-css-modules`At the root of your project, next to your `package.json`, add a `.parcelrc` file and paste the following code:
```json
{
"extends": "@parcel/config-default",
"transformers": {
"*.module.css": [
"parcel-transformer-ts-css-modules",
"..."
]
}
}
```## Configuration
If you want to configure underlying ts-css-modules library, create `./tcm.config.json` file and configure it as it is described in [here](https://www.npmjs.com/package/typed-css-modules#user-content-new-dtscreatoroption).
For instance like this:
```json
{
"camelCase": true
}
```## Example
What it does in practice you can see in this example [here](https://github.dev/dmitrijs-balcers/react-css-modules-typescript-boilerplate/tree/master/src/components).## Contribution
This library is open source and depends on your input. Feel free to suggest improvements and/or contribute!