main.ts
if (environment.production) {
enableProdMode();
}
↓ このように追加します
if (environment.production) {
enableProdMode();
// production環境下では console.log , console.error を何もさせない
if (window) {
window.console.log = () => {};
window.console.error = () => {};
}
}
引用元 : https://bit.ly/3hTy660