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

1.0.1 • Public • Published

tarojs-plugin-unocss

A unocss plugin for TaroJs

Usage

Intallation

npm i tarojs-plugin-unocss -D

Apply plugin

/config/index.js

const config = {
  plugins: [
    [ "tarojs-plugin-unocss", {
        // see https://github.com/unocss/unocss/blob/main/packages/webpack/src/index.ts#L12
        webpackPluginOptions?: WebpackPluginOptions
        // see https://github.com/unocss/unocss/blob/main/packages/core/src/types.ts#L754
        userConfigDefaults?: UserConfigDefaults
      }
    ]
  ]
}

Configure unocss

This plugin enables unocss preset @unocss/preset-uno and unocss transformer @unocss/transformer-directives by default. But you can also customize unocss configuration with uno.config.ts file on the top level of your root project.

// uno.config.ts
import { defineConfig } from "unocss"
export default defineConfig({
  // ...
})

Note: in weapp platform, since some known restricts of miniprogram, unocss separators option is set to ["_"] by default.

Readme

Keywords

Package Sidebar

Install

npm i tarojs-plugin-unocss

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

4.65 kB

Total Files

6

Last publish

Collaborators

  • vinsurs