# css-modules-transform-loader

> 在React中，用来配合css-loader模块中的modules使用。

Latest version **0.1.1** (published 2017-11-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install css-modules-transform-loader
pnpm add css-modules-transform-loader
yarn add css-modules-transform-loader
bun add css-modules-transform-loader
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2017-11-14 |
| First published | 2017-11-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | lzh |
| Maintainers | baqihg |
| Keywords | css-modules, transform |

## Links

- npm: https://www.npmjs.com/package/css-modules-transform-loader
- Repository: https://github.com/baqihg/css-modules-transform-loader
- Homepage: https://github.com/baqihg/css-modules-transform-loader#readme
- Issues: https://github.com/baqihg/css-modules-transform-loader/issues
- npm.io page: https://npm.io/package/css-modules-transform-loader

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2017-11-14
- 0.1.0 — 2017-11-13

## README

# css-modules-transform-loader
在React+Webpack中，用来配合css-loader模块中的modules使用。

## 安装
```
npm i css-modules-transform-loader -S
```

## 用法 
1. 添加在babel-loader或者ts-loader之前（css-loader需要开启modules）
```
{ test: /\.jsx?$/, loader: "css-modules-transform-loader!babel-loader" },
{ test: /\.css$/, loader: "style-loader!css-loader?modules" },
```
2. 在jsx中如下使用
```
const style = require('./hello.css');
<div className="style$hello style$world">
  <div className="style$hello_world">
  </div>    
</div>
```
将会自动转换成
```
<div className={style.hello} + " " + {style$world}>
  <div className={style.hello_world}>
  </div>    
</div>
```

---
_Source: https://npm.io/package/css-modules-transform-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
