Bump Vite build target to es2022 and fail CI on rolldown warnings#37270
Closed
silverwind wants to merge 2 commits intogo-gitea:mainfrom
Closed
Bump Vite build target to es2022 and fail CI on rolldown warnings#37270silverwind wants to merge 2 commits intogo-gitea:mainfrom
silverwind wants to merge 2 commits intogo-gitea:mainfrom
Conversation
Top-level await (used in frontend-openapi-swagger.ts for the CSS import) requires es2022. This silences the TOLERATED_TRANSFORM warning emitted on each build. Browser support for es2022 is available in Chrome 94+, Firefox 93+ and Safari 15+. Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
Install an onwarn handler in commonRolldownOptions that throws when env.CI is set. In local builds the default handler still prints the warning, but CI promotes it to a build failure so tolerated warnings can't silently land on main. Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
Member
Author
|
@wolfbeast fyi, this will be for v1.27. |
Contributor
|
Actually, I am not sure whether it really needs This OK, it seems that it becomes standard in es2022, while some browsers supported it ahead. Maybe it's better to find a way to avoid such top-level await and make the CSS importing work (if possible) |
Contributor
|
The top-level await import is also caused by incorrect Vite manifest parser, it makes the CSS importing very messy. |
Contributor
|
No need to use es2022 -> Fix top-level await #37272 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

1. Bump Vite build target to
es2022Top-level await added in d5831b9 requires
es2022. This fixes theTOLERATED_TRANSFORMwarning emitted on each build:Browser support for
es2022is available in Chrome 94+, Firefox 93+ and Safari 15+.2. Fail the build on rolldown warnings in CI
Adds an
onwarnhandler incommonRolldownOptionsthat throws whenenv.CIis set, so warnings can be noticed in CI. Locally, the default handler still prints them without aborting to not break user builds.This PR was written with the help of Claude Opus 4.7