console.log
itself can be overwritten with an empty function.
// backup just in case you need it later somewhere
var oldConsoleLog = window.console.log;
window.console.log = () => {};
However, it's recommended to do some investigation on the troublesome package, most packages log only in their development build, maybe there is a production version of the package you should use.
Also, there is some babel/webpack plugin that can remove the console statements for you. For example babel-plugin-transform-remove-console
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…