# unplugin-boost-ui

> Boost UI

Latest version **0.0.3** (published 2023-06-28) · 0 weekly downloads

## Install

```sh
npm install unplugin-boost-ui
pnpm add unplugin-boost-ui
yarn add unplugin-boost-ui
bun add unplugin-boost-ui
```

## 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.0.3 |
| Published | 2023-06-28 |
| First published | 2023-06-16 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=14.19.0 |
| Dependencies | 9 |
| Unpacked size | 31 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | agileboost_v2, hu6242075 |
| Keywords | boost-ui, unplugin-boost-ui, vite, webpack, rollup, esbuild, plugin |

## Links

- npm: https://www.npmjs.com/package/unplugin-boost-ui
- Repository: https://github.com/boost-ui/unplugin-boost-ui
- Homepage: https://github.com/boost-ui/unplugin-boost-ui/tree/main/#readme
- Issues: https://github.com/boost-ui/unplugin-boost-ui/issues
- npm.io page: https://npm.io/package/unplugin-boost-ui

## Dependencies (9)

- [resolve](https://npm.io/package/resolve.md) ^1.22.2
- [unplugin](https://npm.io/package/unplugin.md) ^1.3.1
- [local-pkg](https://npm.io/package/local-pkg.md) ^0.4.3
- [minimatch](https://npm.io/package/minimatch.md) ^9.0.1
- [@antfu/utils](https://npm.io/package/@antfu/utils.md) ^0.7.4
- [magic-string](https://npm.io/package/magic-string.md) ^0.30.0
- [es-module-lexer](https://npm.io/package/es-module-lexer.md) ^1.2.1
- [compare-versions](https://npm.io/package/compare-versions.md) ^5.0.3
- [@rollup/pluginutils](https://npm.io/package/@rollup/pluginutils.md) ^5.0.2

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2023-06-28
- 0.0.1-dev.11 — 2023-06-16
- 0.0.1-dev.9 — 2023-06-16
- 0.0.1-dev.8 — 2023-06-16
- 0.0.1-dev.7 — 2023-06-16
- 0.0.1-dev.6 — 2023-06-16
- 0.0.2 — 2023-06-16

## README

<h1 align="center">
  Boost UI
</h1>

<p align="center">
  <a href="https://www.npmjs.org/package/unplugin-boost-ui">
    <img src="https://img.shields.io/npm/v/unplugin-boost-ui.svg">
  </a>
  <a href="https://npmcharts.com/compare/unplugin-boost-ui?minimal=true">
    <img src="http://img.shields.io/npm/dm/unplugin-boost-ui.svg">
  </a>
  <br>
</p>

# unplugin-boost-ui



这个仓库是用于 `Boost UI` 相关的 [unplugin](https://github.com/unjs/unplugin) 插件工具。

###### 功能

- 💚 为 Boost UI 按需引入样式。
- 🌎 替换默认语言。
- ⚡️ 使用 <a href="https://github.com/unjs/unplugin">unplugin</a> 以支持 Vite, Webpack, Vue CLI, Rollup, esbuild 等。

## 安装

```bash
npm i unplugin-boost-ui -D
```

<details>
<summary>Vite</summary><br>

```ts
// vite.config.ts
import BoostUI from 'unplugin-boost-ui/vite'

export default {
  plugins: [
    BoostUI({
      // options
    }),
  ],
}
```

<br></details>

<details>
<summary>Rollup</summary><br>

```ts
// rollup.config.js
import BoostUI from 'unplugin-boost-ui/rollup'

export default {
  plugins: [
    BoostUI({
      // options
    }),
  ],
}
```

<br></details>

<details>
<summary>esbuild</summary><br>

```ts
// esbuild.config.js
import { build } from 'esbuild'

build({
  plugins: [
    require('unplugin-boost-ui/esbuild')({
      // options
    }),
  ],
})
```

<br></details>

<details>
<summary>Webpack</summary><br>

```ts
// webpack.config.js
module.exports = {
  /* ... */
  plugins: [
    require('unplugin-boost-ui/webpack')({
      // options
    }),
  ],
}
```

<br></details>

<details>
<summary>Vue CLI</summary><br>

```ts
// vue.config.js
module.exports = {
  configureWebpack: {
    plugins: [
      require('unplugin-boost-ui/webpack')({
        // options
      }),
    ],
  },
}
```

<br></details>

## 使用

插件会自动转换：

```javascript
import { AgileButton } from 'boost-ui'

//    ↓ ↓ ↓ ↓ ↓ ↓

import { AgileButton } from 'boost-ui'
import 'boost-ui/es/components/button/style/css'
```

## 选项

### `useSource`

```ts
type UseSource = boolean
```

```javascript
// useSource: false
import { AgileButton } from 'boost-ui'

//    ↓ ↓ ↓ ↓ ↓ ↓

import { AgileButton } from 'boost-ui'
import 'boost-ui/es/components/button/style/css'

// useSource: true
import { AgileButton } from 'boost-ui'

//    ↓ ↓ ↓ ↓ ↓ ↓

import { AgileButton } from 'boost-ui'
import 'boost-ui/es/components/button/style/index'
```

### `lib`

一般这个是用不到的，不过作为一个通用选项，还是暴露了出来，如果有用到这个的结构一定要和
BoostUI 的输出包结构一致，详见 [unpkg.com](https://unpkg.com/boost-ui)

```ts
type Lib = string
```

default: 'boost-ui'

```javascript
// lib: 'other-lib'
import { AgileButton } from 'other-lib'

//    ↓ ↓ ↓ ↓ ↓ ↓

import { AgileButton } from 'other-lib'
import 'other-lib/es/components/button/style/css'
```

### format

```ts
type Format = 'esm' | 'cjs'
```

default: 'esm'

`esm` 对应 `[lib]/es/components/*`

`cjs` 对应 `[lib]/lib/components/*`

- `/es` 对应 ES Module 输出
- `/lib` 对应 CommonJS 的输出

使用该选项来选择使用哪一个包。

```javascript
// format: 'cjs'
import { AgileButton } from 'boost-ui'

//    ↓ ↓ ↓ ↓ ↓ ↓

import { AgileButton } from 'boost-ui'
import 'boost-ui/lib/components/button/style/css'
```

### prefix

```ts
type Prefix = string
```

```javascript
// prefix = Al
import { AlButton } from 'xx-lib'
```

### `defaultLocale`

替换默认语言，你可以 [在这](https://github.com/boost-ui/boost-ui/tree/dev/packages/locale/lang) 查看所有语言列表。

## 其他插件

- [unplugin-vue-components](https://github.com/antfu/unplugin-vue-components)

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