-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
fix(prebundle): 兼容 webpack v5.90+ 后新增的 EnvironmentNotSupportAsyncWarn #15597
Merged
Conversation
This file contains 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
16 similar comments
ZakaryCode
approved these changes
Apr 29, 2024
This was referenced May 4, 2024
This was referenced May 4, 2024
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.
…ing 检查问题
这个 PR 做了什么? (简要描述所做更改)
问题描述:
webpack 升级到 v5.90+ 版本后,编译 h5 时会提示目标环境不支持
async/await
的提示问题原因:
webpack v5.90 版本新增了一个
async/await
环境不支持的警告检查逻辑详见:webpack/webpack#17967
Taro webpack 的默认输出目标是
['web', 'es5']
,由于 es5 并不支持async/await
,所以在开发模式下会产生WARNING
问题一:为什么更改了 target 后,用户配置的
browserslist
对output.environment.asyncFunction
的设置不生效?webpack/webpack#18022 (reply in thread)
webpack 配置中的
output.environment
是用于告诉 webpack 在生成的运行时代码中可以使用哪个版本的 ES 特性,这个属性的设置依赖于target
配置。如果用户配置了 target,但属性值中未包含browserslist
,webpack 是不会根据用户配置的browerslist
来设置environmnent
属性值的,所以直接修改项目的browserslist
配置并不会关闭这个WARNING
。这个 PR 是什么类型? (至少选择一个)
这个 PR 涉及以下平台: