Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/babel-plugins/babel-plugin-umi-css-modules

处理样式文件引入路径,添加?cssModules
https://github.com/babel-plugins/babel-plugin-umi-css-modules

babel babel-plugin css-modules umi

Last synced: 23 days ago
JSON representation

处理样式文件引入路径,添加?cssModules

Awesome Lists containing this project

README

        

babel-plugin-umi-css-modules

[![NPM version](https://img.shields.io/npm/v/@babel-plugins/umi-css-modules.svg?style=flat)](https://npmjs.org/package/@babel-plugins/umi-css-modules)
[![NPM downloads](http://img.shields.io/npm/dm/@babel-plugins/umi-css-modules.svg?style=flat)](https://npmjs.org/package/@babel-plugins/umi-css-modules)

## 项目由来

umi通用解决方案 [issue](https://github.com/umijs/umi/issues/1417)

**主要功能**

```
// Input:
import styles from './a.css';
import './b.css';

// Output:
import styles from './a.css?cssModules';
import './b.css';
```

## 安装

```
// npm
npm install --save-dev @babel-plugins/umi-css-modules

// yarn

yarn add --dev @babel-plugins/umi-css-modules
```

## 使用

添加插件到你的babel配置文件中

```

{
"plugins": [
["@babel-plugins/umi-css-modules"]
]
}
```