# unocss-rspack-plugin

> The Rspack plugin for UnoCSS

Latest version **0.57.8** (published 2023-12-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install unocss-rspack-plugin
pnpm add unocss-rspack-plugin
yarn add unocss-rspack-plugin
bun add unocss-rspack-plugin
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.57.8 |
| Published | 2023-12-04 |
| First published | 2023-11-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 7 |
| Unpacked size | 184 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | zonghao |
| Maintainers | zonghao |
| Keywords | unocss, rspack-plugin |

## Links

- npm: https://www.npmjs.com/package/unocss-rspack-plugin
- Repository: https://github.com/zonghow/unocss-rspack-plugin
- Homepage: https://github.com/zonghow/unocss-rspack-plugin#readme
- Issues: https://github.com/zonghow/unocss-rspack-plugin/issues
- npm.io page: https://npm.io/package/unocss-rspack-plugin

## Dependencies (7)

- [fast-glob](https://npm.io/package/fast-glob.md) 3.3.2
- [@unocss/core](https://npm.io/package/@unocss/core.md) 0.57.7
- [magic-string](https://npm.io/package/magic-string.md) 0.30.5
- [@unocss/config](https://npm.io/package/@unocss/config.md) 0.57.7
- [webpack-sources](https://npm.io/package/webpack-sources.md) 3.2.3
- [@rollup/pluginutils](https://npm.io/package/@rollup/pluginutils.md) 5.0.5
- [@ampproject/remapping](https://npm.io/package/@ampproject/remapping.md) 2.2.1

## Recent versions

- 0.57.8 (latest) — 2023-12-04
- 0.57.7 — 2023-11-30

## README

# unocss-rspack-plugin

The Rspack plugin for UnoCSS.

## Getting Started

To begin, you'll need to install `unocss-rspack-plugin`

```console
npm install --save-dev unocss-rspack-plugin

yarn add -D unocss-rspack-plugin

yarn add -D unocss-rspack-plugin
```

### rspack.config.js

```js
const UnoCSS = require("unocss-rspack-plugin");

module.exports = {
  // ...
  plugins: [
    //...
    new UnoCSS(),
  ],
};
```

### uno.config.js

https://unocss.dev/guide/config-file

```js
// uno.config.ts
import { defineConfig } from "unocss";

export default defineConfig({
  // ...UnoCSS options
});
```

### entry js

Add uno.css to your main entry:

```js
import "uno.css";
```

For layers if you have

```js
import "uno.css";
import "uno.utilities.css";
import "uno.components.css";
```

## Options

For Rspack specific reasons, the concatenation of layers cannot use the official colon : , so the layerHyphen configuration is provided, which defaults to . , e.g. `import "uno.mylayer.css"`.

I'm following this issue and will update when it's resolved.

```ts
interface Options {
  layerHyphen?: string;
}
```

---
_Source: https://npm.io/package/unocss-rspack-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
