refactor: downgrade browser targets for swc transformer #689
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.
降级 SWC 作为 transformer 时 browser 产物的 targets 为
{ ie: 11 }
,确保产物是 ES5,与 Babel 保持一致。补充说明:esbuild 的 targets 之所以是 chrome 版本号,是因为很多高级语法它最多只能转换到 ES6,如果设置为
{ ie: 11 }
会报错,但 SWC 有这个能力,所以没必要和 esbuild 一样使用 chrome 版本号cc @MadCcc @huarse