Open lovelmh13 opened 3 years ago
babel 的转换测试可以看官网这里:Try it out
polyfill 指的是 api 的 polyfill。
在 babel 中, polyfill 是需要单独设置 useBuiltIns 通过 corejs 来实现的(vue-cli 里不需要,cli3 默认使用 corejs 2 ,cli4 默认使用 corejs3)。
由于 vue-cli3 使用的是 corejs 2,所以有个大坑!! flat 不能被 polyfill。 flat 的 polyfill 是在 corejs3 中加入的
涉及到的还有 stage
剩下的暂时先看以下文章:
Babel 7 升级实践
不要肆无忌惮地在你的项目中使用 ES78910 了~
babel-preset-app#stage-3-or-below
babel 的转换测试可以看官网这里:Try it out
polyfill 指的是 api 的 polyfill。
在 babel 中, polyfill 是需要单独设置 useBuiltIns 通过 corejs 来实现的(vue-cli 里不需要,cli3 默认使用 corejs 2 ,cli4 默认使用 corejs3)。
由于 vue-cli3 使用的是 corejs 2,所以有个大坑!! flat 不能被 polyfill。 flat 的 polyfill 是在 corejs3 中加入的
涉及到的还有 stage
剩下的暂时先看以下文章:
Babel 7 升级实践
不要肆无忌惮地在你的项目中使用 ES78910 了~
babel-preset-app#stage-3-or-below