Skip to content

Replace uglifyjs-webpack-plugin with terser-webpack-plugin #2245

@DorianGrey

Description

@DorianGrey

What problem does this feature solve?

@vue/cli is currently using uglify-es via the webpack plugin for script minification.
However, regarding this comment, uglify-es is no longer actively maintained. This circumstance resulted in a fork, terser, especially to fix or at least work on the not-that-small amount of issues uglify-es had or still has (at least these).

A PR to swap out uglify-es in favor of terserresulted in a different plugin - terser-webpack-plugin.

Unless the maintenance of uglify-es surprisingly changes, I'd suggest to go with the maintained fork, especially since it has a better chance to get bugs fixed in a more reasonable amount of time.

The new plugin's API is almost equivalent, only uglifyOptions was renamed to terserOptions.

What does the proposed API look like?

No new API; Current API unchanged as long as no one intercepts the minimizer configuration entry (it's currently not possible to just swap out the plugin options of uglifyjs-webpack-plugin via chaining).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions