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: don't override build.target if terser is 5.16.0+ #12197

Merged
merged 3 commits into from
Mar 1, 2023

Conversation

sapphi-red
Copy link
Member

Description

terser now seems to support ES2022 syntaxes.
When this part of code was introduced, terser was lacking support for ES2019+ for a while. But now terser supports new syntax in few month, so I guess we can just drop this condition.

close #12196

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the PR Title Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@sapphi-red sapphi-red added the p2-nice-to-have Not breaking anything but nice to have (priority) label Feb 25, 2023
packages/vite/package.json Outdated Show resolved Hide resolved
@sapphi-red sapphi-red changed the title feat: bump terser and don't override build.target feat: don't override build.target if terser is 5.16.0+ Feb 28, 2023
@patak-dev patak-dev merged commit 9885f6f into main Mar 1, 2023
@patak-dev patak-dev deleted the feat/bump-terser-and-dont-override-target branch March 1, 2023 15:52
@laurentpayot
Copy link
Contributor

Thanks a lot @sapphi-red, I can finally use ES2022 top-level async/await syntax with terser 🎉

@laurentpayot
Copy link
Contributor

Looks like the build.targetdocs need to be updated:

image

@Niputi
Copy link
Contributor

Niputi commented Mar 17, 2023

@laurentpayot please create a new issue regarding the outdated docs so we can track it and you are welcome to send a pull request 😊

laurentpayot added a commit to laurentpayot/vite that referenced this pull request Mar 21, 2023
Updated docs after vitejs#12197: `build.target` is overridden to `'es2021'` for installed Terser versions below 5.16.0 only.
@laurentpayot
Copy link
Contributor

@Niputi PR #12506 just sent 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pollyfill for private class fields is output when using terser to minify but not esbuild
5 participants