2.2.0 • Published 2 years ago

vite-plugin-remove-console v2.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

简体中文 | English

🚀 特性

高精准、零侵入: 精准又完整剔除代码中指定的 console 类型,目前支持剔除文件格式 .js.ts.jsx.tsx.vue.svelte

🧪 完善的示例: 目前我们在 playgrounds 文件夹中加入了 nuxt3preact-jspreact-tsreact-jsreact-tssolid-jssolid-tssvelte-jssvelte-tsvue-jsvue-ts 示例,零使用成本

🦾 可配置:

配置项名称必传含义类型举例
external代表某些文件不进行删除指定 console 类型的操作Array<string>removeConsole({ external: ["src/assets/iconfont/iconfont.js", ...] })
includes指定需要删除的 console 类型,不传 includes 默认删除 console.logArray<string>removeConsole({ includes: ["log", "warn", "error", "info", ...] })
externalValue保留某些 console 语句,若 consolevalue 中有传入的 externalValue 值,则此 console 会被保留Array<string>removeConsole({ externalValue: ["这个不删", "noRemove", ...] })
custom完全自定义需要删除的语句,会覆盖 includesArray<string>removeConsole({ custom: ["console.log()", "console.warn()", "debugger", ...] })

📦 安装

# npm
npm install vite-plugin-remove-console -D

# or yarn
yarn add vite-plugin-remove-console -D

# or pnpm
pnpm add vite-plugin-remove-console -D

📕 用法

// vite.config.ts

import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import removeConsole from "vite-plugin-remove-console";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue(), removeConsole()]
});

Refer to more examples

许可证

MIT © 2022-present, xiaoxian521

2.2.0

2 years ago

2.1.1

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago

1.2.0

3 years ago

1.3.0

3 years ago

1.0.2

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.0.10

3 years ago

0.0.11

3 years ago

0.0.12

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago