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

terser 5.16.4 will not work properly with webpack4.x #1461

Open
simo-an opened this issue Oct 19, 2023 · 0 comments
Open

terser 5.16.4 will not work properly with webpack4.x #1461

simo-an opened this issue Oct 19, 2023 · 0 comments

Comments

@simo-an
Copy link

simo-an commented Oct 19, 2023

Bug report or Feature request?

Help wanted.

Version 5.16.4 +

terser input

function num() { return 1 }

function print() {
  let a = num();

  try {
    let b = 2;
    console.warn(b)
  } finally {
    console.warn(a)
  }
}

terser output or error

function num() {
  return 1;
}
function print() {
  let n = num();
  try {
    let n = 2;
    console.warn(n);
  } finally {
    console.warn(n);
  }
}

Due to the update https://github.com/terser/terser/blob/master/CHANGELOG.md#v5164
Output code will use the same var name n

If the output code built with webpack4.x again, the first var n will be removed.

But webpack team think that webpack4.x is not maintained (webpack/webpack#17713 (comment))

is there any suggestions that can solve it? Thanks.

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