diff --git a/README.md b/README.md index c56ffd7..7fe9950 100644 --- a/README.md +++ b/README.md @@ -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` | `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` | `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` | `removeConsole({ externalValue: ["这个不删", "noRemove", ...] })` | -| custom | No | Completely customize the statements that need to be removed, which will overwrite `includes` | `Array` | `removeConsole({ custom: ["console.log()", "console.warn()", "debugger", ...] })` | +| `custom` | No | Completely customize the statements that need to be removed, which will overwrite `includes` | `Array` | `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"; diff --git a/README.zh_CN.md b/README.zh_CN.md index 0867b10..385340d 100644 --- a/README.zh_CN.md +++ b/README.zh_CN.md @@ -20,22 +20,27 @@ | :-------------- | :------- | :----------------------------------------------------------- | :-------------- | :----------------------------------------------------------- | | `external` | 否 | 代表某些文件不进行删除指定 `console` 类型的操作 | `Array` | `removeConsole({ external: ["src/assets/iconfont/iconfont.js", ...] })` | | `includes` | 否 | 指定需要删除的 `console` 类型,不传 `includes` 默认删除 `console.log` | `Array` | `removeConsole({ includes: ["log", "warn", "error", "info", ...] })` | -| `externalValue` | 否 | 保留某些 `console` 语句,若 `console`的 `value` 中有传入的 `externalValue` 值,则此 `console` 会被保留 | `Array` | `removeConsole({ externalValue: ["这个不删", "noRemove", ...] })` | -| `custom` | 否 | 完全自定义需要删除的语句,会覆盖`includes` | `Array` | `removeConsole({ custom: ["console.log()", "console.warn()", "debugger", ...] })` | +| `externalValue` | 否 | 保留某些 `console` 语句,若 `console` 的 `value` 中有传入的 `externalValue` 值,则此 `console` 会被保留 | `Array` | `removeConsole({ externalValue: ["这个不删", "noRemove", ...] })` | +| `custom` | 否 | 完全自定义需要删除的语句,会覆盖 `includes` | `Array` | `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";