1. rollup-plugin-strip
Remove debugger statements and functions like assert.equal and console.log from your code.
rollup-plugin-strip
Package: rollup-plugin-strip
Created by: rollup
Last modified: Sun, 26 Jun 2022 14:01:53 GMT
Version: 1.2.2
License: MIT
Downloads: 4,489
Repository: https://github.com/rollup/rollup-plugin-strip

Install

npm install rollup-plugin-strip
yarn add rollup-plugin-strip

rollup-plugin-strip

Remove debugger statements and functions like assert.equal and console.log from your code.

Installation

 npm install --save-dev rollup-plugin-strip

Usage

 // rollup.config.js
import strip from 'rollup-plugin-strip';

export default {
  input: 'src/index.js',
  output: [
    {
      format: 'cjs',
      file: 'dist/my-lib.js'
    }
  ],
  plugins: [
    strip({
      // set this to `false` if you don't want to
      // remove debugger statements
      debugger: true,

      // defaults to `[ 'console.*', 'assert.*' ]`
      functions: [ 'console.log', 'assert.*', 'debug', 'alert' ],

      // set this to `false` if you're not using sourcemaps –
      // defaults to `true`
      sourceMap: true
    })
  ]
};

License

MIT

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin