0.2.1 • Published 1 year ago

unplugin-strip v0.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

unplugin-strip

NPM version

šŸ£ 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.