Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vite-plugin-remove-console

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-plugin-remove-console

A vite plugin that remove the types of console in the production environment

  • 2.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6.2K
decreased by-44.39%
Maintainers
1
Weekly downloads
 
Created
Source

vite-plugin-remove-console

A vite plugin that remove all the specified console types in the production environment

NPM version NPM Downloads

English | 简体中文

🚀 Features

High precision, zero intrusion: Accurately and completely remove the console type specified in the code, and currently support the removal of file formats .js.ts.jsx.tsx.vue.svelte
🧪 Perfect example: Currently we have added nuxt3preact-jspreact-tsreact-jsreact-tssolid-jssolid-tssvelte-jssvelte-tsvue-jsvue-ts examples to the playgrounds folder, zero usage cost
🦾 Configurable:
configurationmustmeaningtypeexample
externalNosupported to pass external to represent certain files not to delete the specified console type of operationArray<string>removeConsole({external: ["src/assets/iconfont/iconfont.js",...]})
includesNosupports passing includes to specify the type of console that needs to be removed,If includes is not passed, console.log will be removed by defaultArray<string>removeConsole({ includes: ["log", "warn", "error", "info", ...] })
externalValueNosome console statements are reserved, if there is an incoming externalValue value in the value of the console, the console will be preservedArray<string>removeConsole({ externalValue: ["这个不删", "noRemove", ...] })
customNoCompletely customize the statements that need to be removed, which will overwrite includesArray<string>removeConsole({ custom: ["console.log()", "console.warn()", "debugger", ...] })

📦 install

# 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

📕 Usage

// 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

License

MIT © 2022-present, xiaoxian521

Keywords

FAQs

Package last updated on 04 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc