Skip to content

Commit

Permalink
docs: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxian521 committed Dec 4, 2023
1 parent a39e526 commit cea7ff8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,26 @@ English | [简体中文](./README.zh_CN.md)
| `external` | No | supported to pass external to represent certain files not to delete the specified `console` type of operation | `Array<string>` | `removeConsole({external: ["src/assets/iconfont/iconfont.js",...]})` |
| `includes` | No | supports passing `includes` to specify the type of `console` that needs to be removed,If `includes` is not passed, `console.log` will be removed by default | `Array<string>` | `removeConsole({ includes: ["log", "warn", "error", "info", ...] })` |
| `externalValue` | No | some `console` statements are reserved, if there is an incoming `externalValue` value in the `value` of the `console`, the `console ` will be preserved | `Array<string>` | `removeConsole({ externalValue: ["这个不删", "noRemove", ...] })` |
| custom | No | Completely customize the statements that need to be removed, which will overwrite `includes` | `Array<string>` | `removeConsole({ custom: ["console.log()", "console.warn()", "debugger", ...] })` |
| `custom` | No | Completely customize the statements that need to be removed, which will overwrite `includes` | `Array<string>` | `removeConsole({ custom: ["console.log()", "console.warn()", "debugger", ...] })` |

## 📦 install

```bash
# npm
npm install vite-plugin-remove-console -D
or
# or yarn
yarn add vite-plugin-remove-console -D
# or pnpm
pnpm add vite-plugin-remove-console -D
```

## 🦄 Usage

vite.config.ts
## 📕 Usage

```ts
// vite.config.ts
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import removeConsole from "vite-plugin-remove-console";
Expand Down
17 changes: 11 additions & 6 deletions README.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,27 @@
| :-------------- | :------- | :----------------------------------------------------------- | :-------------- | :----------------------------------------------------------- |
| `external` | | 代表某些文件不进行删除指定 `console` 类型的操作 | `Array<string>` | `removeConsole({ external: ["src/assets/iconfont/iconfont.js", ...] })` |
| `includes` | | 指定需要删除的 `console` 类型,不传 `includes` 默认删除 `console.log` | `Array<string>` | `removeConsole({ includes: ["log", "warn", "error", "info", ...] })` |
| `externalValue` | | 保留某些 `console` 语句,若 `console` `value` 中有传入的 `externalValue` 值,则此 `console` 会被保留 | `Array<string>` | `removeConsole({ externalValue: ["这个不删", "noRemove", ...] })` |
| `custom` | | 完全自定义需要删除的语句,会覆盖`includes` | `Array<string>` | `removeConsole({ custom: ["console.log()", "console.warn()", "debugger", ...] })` |
| `externalValue` | | 保留某些 `console` 语句,若 `console` `value` 中有传入的 `externalValue` 值,则此 `console` 会被保留 | `Array<string>` | `removeConsole({ externalValue: ["这个不删", "noRemove", ...] })` |
| `custom` | | 完全自定义需要删除的语句,会覆盖 `includes` | `Array<string>` | `removeConsole({ custom: ["console.log()", "console.warn()", "debugger", ...] })` |

## 📦 安装

```bash
# npm
npm install vite-plugin-remove-console -D
or
# or yarn
yarn add vite-plugin-remove-console -D
# or pnpm
pnpm add vite-plugin-remove-console -D
```

## 🦄 用法

vite.config.ts
## 📕 用法

```ts
// vite.config.ts
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import removeConsole from "vite-plugin-remove-console";
Expand Down

0 comments on commit cea7ff8

Please sign in to comment.