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

Mangling error fixed with Terser, not UglifyJS #85

Open
stuartlangridge opened this issue Oct 29, 2021 · 0 comments
Open

Mangling error fixed with Terser, not UglifyJS #85

stuartlangridge opened this issue Oct 29, 2021 · 0 comments

Comments

@stuartlangridge
Copy link

stuartlangridge commented Oct 29, 2021

https://github.com/optoolco/tonic/blob/master/HELP.md under the heading "Webpack 4+ Mangling Error" suggests that a "Mangling" error in the console when using webpack is fixable by adding the keep_fnames option to the UglifyJS config in your webpack config. However, Webpack now comes with TerserPlugin out of the box, and it's that that's mangling the names by default; it may be worth adding to those docs to suggest making a change as follows:

...
    optimization: {
        minimizer: [ // needed for Tonic
            new TerserPlugin({
                terserOptions: {
                    keep_fnames: true
                }
            })
        ]
    }
...

to the webpack configuration. (This is exactly what's there already, except for Terser, not UglifyJS).

This isn't a PR because there may be other better Tonic-ish options that should also be set for Terser and I don't know what they would be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant