Skip to content

Add more properties for UglifyJsPlugin #3270

Closed

Description

@FilipeQ

Hi,
Is there any way to set up more properties for webpack.optimize.UglifyJsPlugin?

For example I want use more properties for the production bundle, like remove comments, reduce vars, etc.

Thx.

Activity

  1. grizzm0 commented on Nov 24, 2016

    @grizzm0
    Contributor

    There is currently no built in support for altering the webpack config. This is something that has been discussed and will be looked closed at after v1.0.

    The "easiest" way to do it right now is to checkout angular-cli and link it up to npm and your project. Then you can simply edit packages/angular-cli/models/webpack-build.*.ts

  2. FilipeQ commented on Nov 24, 2016

    @FilipeQ
    Author

    Ok, but why angular-cli for production environment don't use more properties like remove comments, or others that help to improve the production bundle?

  3. grizzm0 commented on Nov 24, 2016

    @grizzm0
    Contributor

    I myself added postcss-discard-comments which saved lots of kilobytes. See #2593

    There is an open issue about JS-comments not being removed in #2386. This has to be advised by the legal team before being applied.

  4. grizzm0 commented on Nov 24, 2016

    @grizzm0
    Contributor

    Just tried removing comments in the JS aswell. Made my main.bundle.js.gz go from 303kb to 298kb. Not that much of a difference.

  5. filipesilva commented on Dec 29, 2016

    @filipesilva
    Contributor

    Closing as there are other issues that cover this as @grizzm0 mentioned.

  6. angular-automatic-lock-bot commented on Sep 6, 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.

  7. locked and limited conversation to collaborators on Sep 6, 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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions