Skip to content

How can remove some lines before build #6925

Closed

Description

@kishanmundha

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

Versions.

@angular/cli: 1.1.3
node: 7.10.0

How can remove some lines before build

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.

Activity

  1. devoto13 commented on Jul 13, 2017

    @devoto13
    Contributor

    Maybe Angular itself will support it one day. See Igor's review for angular/angular#17399.

  2. tmakin commented on Jul 18, 2017

    @tmakin

    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:

    new webpack.optimize.UglifyJsPlugin(<any>{

  3. added
    P5The team acknowledges the request but does not plan to address it, it remains open for discussion
    on Jul 20, 2017
  4. removed their assignment
    on Feb 6, 2018
  5. angular-automatic-lock-bot commented on Sep 9, 2019

    @angular-automatic-lock-bot

    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.

  6. locked and limited conversation to collaborators on Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P5The team acknowledges the request but does not plan to address it, it remains open for discussionseverity2: inconvenient

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions