babel-preset-stage-0,babel-preset-stage-1等有什么区别? [英] What's the difference between babel-preset-stage-0, babel-preset-stage-1 etc?

查看:435
本文介绍了babel-preset-stage-0,babel-preset-stage-1等有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是:babel-preset-stage-0babel-preset-stage-1babel-preset-stage-2babel-preset-stage-3有什么区别,并且当我们使用ES6开发时最好的选择是什么?

My question is : What's the difference between babel-preset-stage-0,babel-preset-stage-1,babel-preset-stage-2 and babel-preset-stage-3, and what's the best choice when we develop with ES6?

推荐答案

Babel的舞台预设等于 TC39流程以及每个提案可能会更改语言的不同状态.它们包括该阶段所有拟议变更的实现和polyfill.

Babel's stage presets equate to the TC39 Process and the different states of each proposal for a potential language change. They include implementations and polyfills for all of the proposed changes in that stage.

Stage-0中当前使用的是Strawman,不是 ES6.它是未来的Javascript,而且绝对不确定是否会将其纳入任何正式的ECMAScript规范中.

Anything currently in Stage-0 is Strawman, not ES6. It is future Javascript and absolutely not certain that it will ever make it into any official ECMAScript specification.

请不要仅将其设置为stage-0 ,这样它就可以在不了解其后果的情况下正常工作.

Please do not just set to stage-0 so it will work without understanding the consequences this will have.

仅包含ES6功能的Babel预设为 preset-es2015

The Babel Preset which contains only ES6 features is preset-es2015

这篇关于babel-preset-stage-0,babel-preset-stage-1等有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆