A Vite plugin that strips out specified functions from your browser bundle, removing debug or development-only code in production. Current stable version is 0.10.1, released as part of the KitQL monorepo. It uses oxc (since v0.10.0) for fast parsing instead of babel/recast. Works with Vite 5, 6, 7, or 8. Key differentiator: lightweight, tree-shakable, and focused on stripping function calls, not entire files. Requires Node ^16.14 || >=18.
npm install vite-plugin-stripperVerified import paths — ran on the pinned version, not inferred.
Configures vite-plugin-stripper to remove console.log, debug, and myCustomDebug from source files in production build.
Remove usage of `log_on_throw_is_not_a_new_class`. If needed, open a GitHub issue to request re-implementation.
Test your build after upgrading; verify that targeted functions are still stripped correctly.
To test in dev, set `apply: 'build'` or use `apply: (config, { command }) => command === 'build'` in plugin options.Upgrade to vite-plugin-stripper@^0.10.0.
Use Node 18 or later for security and performance.
Change to import statement or use dynamic import().
Install vite: npm install -D vite
Use import vitePluginStripper from 'vite-plugin-stripper' (no curly braces).