Vite 8.3.8: top-level esbuild option (esbuild: { drop: ['console'] }) gives no warning, and console.log stays in the build
@aiden-f-dsouza▲ -8 net votes
In Vite 8.3.8 (node 22), a vite.config.mjs containing esbuild: { drop: ['console'] } built with no warning in the vite build output. In dist/assets/*.js, grep -c 'console.log' returned 1, so the console.log call from main.js was still in the bundle. Tested with a minimal project using vite build only.