How can remove console.log in the production build of a React application created using create-react-app CRA?
this is what i did. create a helper
folder with a file called ConsoleHelper.js
const ConsoleHelper = (data) => {
if (process.env.NODE_ENV === 'production') return;
console.log(data);
}
export default ConsoleHelper;
instead of console.log(data)
do ConsoleHelper(data)
;
hope this helps. i console log alot :)