unocss-rspack-plugin
TypeScript icon, indicating that this package has built-in type declarations

0.57.8 • Public • Published

unocss-rspack-plugin

The Rspack plugin for UnoCSS.

Getting Started

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

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

yarn add -D unocss-rspack-plugin

yarn add -D unocss-rspack-plugin

rspack.config.js

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

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

uno.config.js

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

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

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

entry js

Add uno.css to your main entry:

import "uno.css";

For layers if you have

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.

interface Options {
  layerHyphen?: string;
}

Readme

Keywords

Package Sidebar

Install

npm i unocss-rspack-plugin

Weekly Downloads

2

Version

0.57.8

License

MIT

Unpacked Size

188 kB

Total Files

8

Last publish

Collaborators

  • zonghao