Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
vite-plugin-remove-console
Advanced tools
A vite plugin that remove the types of console in the production environment
A vite plugin that remove all the specified console types in the production environment
English | 简体中文
console
type specified in the code, and currently support the removal of file formats .js
、.ts
、.jsx
、.tsx
、.vue
、.svelte
nuxt3
、preact-js
、preact-ts
、react-js
、react-ts
、solid-js
、 solid-ts
、 svelte-js
、svelte-ts
、vue-js
、vue-ts
examples to the playgrounds folder, zero usage costconfiguration | must | meaning | type | example |
---|---|---|---|---|
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", ...] }) |
npm install vite-plugin-remove-console -D
or
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
2.1.1 (2023-04-26)
nuxt3
demo in playgroundsFAQs
A vite plugin that remove the types of console in the production environment
The npm package vite-plugin-remove-console receives a total of 8,428 weekly downloads. As such, vite-plugin-remove-console popularity was classified as popular.
We found that vite-plugin-remove-console demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.