SoFunction
Updated on 2025-04-04

Method practice of vite packaging removal and debugging

Step 1: Since vite does not have an integrated terser plug-in, you need to install it first

// Installnpm install terser --save-dev

Step 2: Write in

// Installimport { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue'
export default defineConfig({
   plugins: [vue()],
   build:{
      minify:"terser",
      terserOptions:{
        compress:{
          drop_console:true,
          drop_debugger:true
        }
      }
    }
});
   

Step 3: Package and verify

npm run build

This is the article about the practice of vite packaging removal and debugging. For more related vite packaging removal and debugging, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!