x)- [ ] bug report -> please search issues before submitting
- [x] feature request
@angular/cli: 1.1.3
node: 7.10.0
I'm putting logs in my code for debugging and logging. These logs are putted in every file, every function. I can simple build my app by ng build or ng build --prod. Problem is if I remove all logs from my app dist folder size can be decrease. I don't want to remove logs for debug environment, but I wan't to remove all logs file before build it.
I search about this problem, but I i did't get any proper solution.
How can I achieve this.
Maybe Angular itself will support it one day. See Igor's review for https://github.com/angular/angular/pull/17399.
Whilst researching this issue I found the drop_console option in uglify js. I don't know how well it work, but it could be a super easy way to implement this.
https://github.com/mishoo/UglifyJS2/blob/v2.x/README.md
I guess it would need to be passed into the webpack production config here:
https://github.com/angular/angular-cli/blob/67646796d977bd476c3f618dd64a6c2b6c4ddcae/packages/%40angular/cli/models/webpack-configs/production.ts#L89
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
Whilst researching this issue I found the
drop_consoleoption in uglify js. I don't know how well it work, but it could be a super easy way to implement this.https://github.com/mishoo/UglifyJS2/blob/v2.x/README.md
I guess it would need to be passed into the webpack production config here:
https://github.com/angular/angular-cli/blob/67646796d977bd476c3f618dd64a6c2b6c4ddcae/packages/%40angular/cli/models/webpack-configs/production.ts#L89