shfshanyue / Daily-Question

互联网大厂内推及大厂面经整理,并且每天一道面试题推送。每天五分钟,半年大厂中

Home Page:https://q.shanyue.tech

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

【Q748】在 babel 编译为低版本 ES 时,为何能够编译可选链之类语法,但无法编译 API

shfshanyue opened this issue · comments

https://q.shanyue.tech/engineering/734.html

babel/swc 只能处理操作符,而无法处理新的 API。如果需要处理 API 兼容,则需要引入 core-js 增加垫片代码