{"id":22854,"library":"vite-plugin-stripper","title":"vite-plugin-stripper","description":"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.","status":"active","version":"0.10.1","language":"javascript","source_language":"en","source_url":"https://github.com/jycouet/kitql","tags":["javascript","vite","vite-plugin","typescript"],"install":[{"cmd":"npm install vite-plugin-stripper","lang":"bash","label":"npm"},{"cmd":"yarn add vite-plugin-stripper","lang":"bash","label":"yarn"},{"cmd":"pnpm add vite-plugin-stripper","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency: plugin runs as a Vite plugin","package":"vite","optional":false}],"imports":[{"note":"ESM-only; CJS require will fail.","wrong":"const vitePluginStripper = require('vite-plugin-stripper')","symbol":"vitePluginStripper","correct":"import vitePluginStripper from 'vite-plugin-stripper'"},{"note":"Type import; available since 0.10.0.","symbol":"StripperOptions","correct":"import type { StripperOptions } from 'vite-plugin-stripper'"},{"note":"The default export is the plugin function; named export does not exist.","wrong":"import { vitePluginStripper } from 'vite-plugin-stripper'","symbol":"default (plugin function)","correct":"import vitePluginStripper from 'vite-plugin-stripper'\nexport default { plugins: [vitePluginStripper()] }"}],"quickstart":{"code":"// vite.config.ts\nimport { defineConfig } from 'vite'\nimport vitePluginStripper from 'vite-plugin-stripper'\n\nexport default defineConfig({\n  plugins: [\n    vitePluginStripper({\n      strip: ['console.log', 'debug', 'myCustomDebug'],\n      include: ['src/**/*.ts'],\n      exclude: ['node_modules/**'],\n      sourcemap: true\n    })\n  ]\n})","lang":"typescript","description":"Configures vite-plugin-stripper to remove console.log, debug, and myCustomDebug from source files in production build."},"warnings":[{"fix":"Remove usage of `log_on_throw_is_not_a_new_class`. If needed, open a GitHub issue to request re-implementation.","message":"Since v0.10.0, the option `log_on_throw_is_not_a_new_class` has been removed.","severity":"breaking","affected_versions":">=0.10.0"},{"fix":"Test your build after upgrading; verify that targeted functions are still stripped correctly.","message":"Parsing engine changed from babel/recast to oxc in v0.10.0, which may produce different AST results and potentially different stripping behavior.","severity":"breaking","affected_versions":">=0.10.0"},{"fix":"To test in dev, set `apply: 'build'` or use `apply: (config, { command }) => command === 'build'` in plugin options.","message":"The plugin is only active in production builds by default. It does not strip functions in dev mode.","severity":"gotcha","affected_versions":"*"},{"fix":"Upgrade to vite-plugin-stripper@^0.10.0.","message":"If using Vite 5, ensure vite-plugin-stripper version is at least 0.10.0 (which supports Vite 5). Older versions may not work.","severity":"gotcha","affected_versions":"<0.10.0"},{"fix":"Use Node 18 or later for security and performance.","message":"Node 16 support is deprecated as of v0.10.0? The engine field allows ^16.14, but Node 16 is end-of-life.","severity":"deprecated","affected_versions":">=0.10.0"}],"env_vars":null,"search_vec":"'0.10.1':30 '16.14':74 '18':75 '5':52 '6':53 '7':54 '8':56 'babel/recast':48 'browser':15 'bundl':16 'call':68 'code':23 'current':26 'debug':18 'develop':21 'development-on':20 'differenti':58 'entir':70 'fast':44 'file':71 'focus':64 'function':12,67 'instead':46 'javascript':76 'key':57 'kitql':36 'lightweight':59 'monorepo':37 'node':73 'oxc':40 'pars':45 'part':33 'plugin':3,7,80 'product':25 'releas':31 'remov':17 'requir':72 'shakabl':62 'sinc':41 'specifi':11 'stabl':27 'strip':9,66 'stripper':4 'tree':61 'tree-shak':60 'typescript':81 'use':39 'v0.10.0':42 'version':28 'vite':2,6,51,77,79 'vite-plugin':78 'vite-plugin-stripp':1 'work':49","created_at":"2026-04-27T17:07:26.479366+00:00","updated_at":"2026-04-27T17:07:26.479366+00:00","problems":[{"fix":"Change to import statement or use dynamic import().","cause":"Using CommonJS require() to import an ESM-only package.","error":"require() of ES Module /path/to/node_modules/vite-plugin-stripper/dist/index.mjs not supported"},{"fix":"Install vite: npm install -D vite","cause":"Missing peer dependency 'vite'.","error":"ERR_MODULE_NOT_FOUND: Cannot find package 'vite'"},{"fix":"Use import vitePluginStripper from 'vite-plugin-stripper' (no curly braces).","cause":"Using named import instead of default import.","error":"TypeError: vitePluginStripper is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":"https://www.kitql.dev/","github":"https://github.com/jycouet/kitql","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/vite-plugin-stripper","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-18","next_check":"2026-07-26","install_tag":null}}