바벨 설정을 통해 일괄로 콘솔 관련 부분을 제거하고 배포용 빌드를 할 수 있다.
바벨 플러그인 설치
$ npm i babel-plugin-transform-remove-console --save-dev
적용
.babelrc
파일 수정production
모드로 빌드 시,transform-remove-console
플러그인을 동작시켜서console.*
부분을 다 지운다.
{ "env": { "production": { "plugins": ["transform-remove-console"] } } }