Vite drop console.log but keep console.error on esbuild

I want to remove the console.logs in the build but don’t want to remove the console.errors, is there a way to do this?

This is what I currently have.

    esbuild: {
      drop: mode === 'production' ? ['console', 'debugger'] : undefined
    },

This is also drops the console.errors.

Do I need to create a plugin or a rollup?