# vite-plugin-antd-static-theme

> vite antd theme plugin

Latest version **0.0.2** (published 2021-09-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install vite-plugin-antd-static-theme
pnpm add vite-plugin-antd-static-theme
yarn add vite-plugin-antd-static-theme
bun add vite-plugin-antd-static-theme
```

## Health

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

Positive: has types; no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2021-09-16 |
| First published | 2021-09-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 10.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | gavin |
| Maintainers | ggboy.guo |
| Keywords | antd, ant, design, pro, theme, vite |

## Links

- npm: https://www.npmjs.com/package/vite-plugin-antd-static-theme
- Repository: https://github.com/G-G-boy/vite-plugin-antd-static-theme
- Homepage: https://github.com/G-G-boy/vite-plugin-antd-static-theme#readme
- Issues: https://github.com/G-G-boy/vite-plugin-antd-static-theme/issues
- npm.io page: https://npm.io/package/vite-plugin-antd-static-theme

## Dependencies (4)

- [rimraf](https://npm.io/package/rimraf.md) ^3.0.2
- [slash2](https://npm.io/package/slash2.md) ^2.0.0
- [serve-static](https://npm.io/package/serve-static.md) ^1.14.1
- [antd-pro-merge-less](https://npm.io/package/antd-pro-merge-less.md) ^3.0.11

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2021-09-16
- 0.0.1 — 2021-09-13

## README

# vite-plugin-antd-static-theme

根据 umi 插件 [umi-plugin-antd-theme](https://github.com/chenshuai2144/umi-plugin-antd-theme) 修改的 vite 插件

## install

```shell
npm i vite-plugin-antd-static-theme -D # yarn add vite-plugin-antd-static-theme -D
```

## demo

```ts
//vite.config.ts
import {defineConfig} from 'vite';
import ViteAntdTheme from 'vite-plugin-antd-static-theme';

export default defineConfig(() => ({
  plugins: [viteAntdTheme(options)],
}));
```

```json5
//options
{
  theme: [
    {
      theme: 'dark',
      fileName: 'dark.css',
    },
    {
      fileName: 'mingQing.css',
      modifyVars: {
        '@primary-color': '#13C2C2',
      },
    },
  ],
  // 是否压缩css
  min: true,
  // css module
  isModule: true,
  // 忽略 antd 的依赖
  ignoreAntd: false,
  // 忽略 pro-layout
  ignoreProLayout: false,
  // 不使用缓存
  cache: true,
}
```

可以通过 window.vite_plugin_ant_themeVar 获取 theme

```ts
//获取ts提示
declare interface Window {
  vite_plugin_ant_themeVar: {
    key?: string;
    theme?: string;
    fileName?: string;
    modifyVars?: Record<string, string>;
  }[];
}
```

### [点我跳到示例代码](https://github.com/G-G-boy/vite-react-ts-demo)

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