babel-preset-stage-0,babel-preset-stage-1等有什么区别? [英] What's the difference between babel-preset-stage-0, babel-preset-stage-1 etc?
问题描述
我的问题是:babel-preset-stage-0
,babel-preset-stage-1
,babel-preset-stage-2
和babel-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屋!