
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
unplugin-remove
Advanced tools
Plugin to remove console.xx and debugger for Vite & Webpack & Esbuild & Rollup
Auto remove console[log|warn|error|info|debug] and debugger in production mode.
[npm|pnpm] i unplugin-remove -D
or
yarn add unplugin-remove -D
Example: playground/
// vite.config.ts
import viteRemove from 'unplugin-remove/vite'
export default defineConfig({
plugins: [
viteRemove({ /* options */ }),
],
})
// rollup.config.js
import rollupRemove from 'unplugin-remove/rollup'
export default {
plugins: [
rollupRemove({ /* options */ }),
],
}
// webpack.config.js
module.exports = {
/* ... */
plugins: [
process.env.MODE === 'production' ? require('unplugin-remove/webpack')({ /* options */ }) : null,
].filter(Boolean),
}
// esbuild.config.js
import { build } from 'esbuild'
import esbuildRemove from 'unplugin-remove/esbuild'
build({
plugins: [esbuildRemove()],
})
// rspack.config.js
const RspackPlugin = require('unplugin-remove/rspack').default
module.exports = {
plugins: [
new rspack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
}),
RspackPlugin(),
],
}
// rolldown.config.js
import { defineConfig } from 'rolldown'
import Rolldown from 'unplugin-remove/rolldown'
export default defineConfig({
plugins: [
process.env.MODE === 'production' ? Rolldown() : null,
],
})
The following shows the default values of the configuration
Remove({
// don't remove console.([log|warn|error|info|debug]) and debugger these module
external: [],
// remove console type of these module
// enum: ['log', 'warn', 'error', 'info', 'debug']
consoleType: ['log'],
// filters for transforming targets
include: [/\.[jt]sx?$/, /\.vue\??/],
exclude: [/node_modules/, /\.git/]
})
You can see CHANGELOG here.
MIT License © 2022-PRESENT Talljack
FAQs
Plugin to remove console.xx and debugger for Vite & Webpack & Esbuild & Rollup
The npm package unplugin-remove receives a total of 103,672 weekly downloads. As such, unplugin-remove popularity was classified as popular.
We found that unplugin-remove demonstrated a not healthy version release cadence and project activity because the last version was released 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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.