unplugin-strip
v0.2.1
Published
A universal bundler plugin to remove `debugger` statements and functions like `assert.equal` and `console.log` from your code.
Downloads
5
Maintainers
Readme
unplugin-strip
🍣 A universal bundler plugin to remove debugger
statements and functions like assert.equal
and console.log
from your code.
Install
npm i unplugin-strip
// vite.config.ts
import UnpluginStrip from 'unplugin-strip/vite'
export default defineConfig({
plugins: [
UnpluginStrip({
/* options */
}),
],
})
Example: playground/
// rollup.config.js
import UnpluginStrip from 'unplugin-strip/rollup'
export default {
plugins: [
UnpluginStrip({
/* options */
}),
],
}
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require('unplugin-strip/webpack')({
/* options */
}),
],
}
// nuxt.config.js
export default defineNuxtConfig({
modules: [
[
'unplugin-strip/nuxt',
{
/* options */
},
],
],
})
This module works for both Nuxt 2 and Nuxt Vite
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require('unplugin-strip/webpack')({
/* options */
}),
],
},
}
// esbuild.config.js
import { build } from 'esbuild'
import UnpluginStrip from 'unplugin-strip/esbuild'
build({
plugins: [UnpluginStrip()],
})
Usage
Options
For all options please refer to docs.
This plugin accepts all @rollup/plugin-strip options.