I have an Angular 6.x library project and compiling the library with --prod does not remove calls to console.log. Is there a parameter that will remove all console.log calls during compilation?
I have an Angular 6.x library project and compiling the library with --prod does not remove calls to console.log. Is there a parameter that will remove all console.log calls during compilation?
in main.ts file add this
f(your_env === 'prod') {
window.console.log = function(){};
}
a simple fix would be
if (environment.production) {
enableProdMode();
if(window){
window.console.log=function(){};
}
}