Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): Adding support for custom uglify options in .angular-cli.json #5192

Closed
wants to merge 2 commits into from

Conversation

jgodi
Copy link

@jgodi jgodi commented Mar 2, 2017

Description

Adding an option into the .angular-cli.json to provide custom options to the UglifyJsPlugin that is used for production builds.

Why?

We are using some older libraries inside our Angular application that when we build for production we require the compress: { keep_fnames: true } on the UglifyJsPlugin plugin. The CLI does not currently support this, so I added a way to pass any options to the UglifyJsPlugin.

The .angular-cli.json can now have the following property:

"apps": [{
    "uglifyOptions": {
        "mangle": {
            "keep_fnames": true
        }
    }
}]

Then this will just merge the already defaulted options that were there with any new options that the user needs or wants.

This issue was brought up and closed in a few PRs and tickets, but there was never a solution. (#1662 & #3167)

@Brocco
Copy link
Contributor

Brocco commented Mar 3, 2017

Thank you for putting in the time for this PR. However the CLI's current approach to build customization is via the eject option (ng eject) which will give users full control over the build process.

There are plans in the future to allow incremental changes to the existing build process without having to eject but that level of granularity is not ready yet.

@nschipperbrainsmith
Copy link

@Brocco is this still the way to go about it by ejecting the full config in case I wish to modify the mangle keep_fnames option within the models/webpack-configs/production.js ? I would love to be able to simply change that one option to say don't mangle my names.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants