What's the difference between babel-preset-stage-0, babel-preset-stage-1 etc?

后端 未结 5 1538
北海茫月
北海茫月 2020-12-07 13:47

My question is : What\'s the difference between babel-preset-stage-0,babel-preset-stage-1,babel-preset-stage-2 and babel-preset-

5条回答
  •  心在旅途
    2020-12-07 14:19

    The original question is "What's the difference between babel-preset-stage-0,babel-preset-stage-1,babel-preset-stage-2 and babel-preset-stage-3", it's odd that answers focusing on "difference between TC39 stage-0, stage-1.. terminology" get voted, while the only one relevant(though not accurate) is down voted. To quote from babel site:

    A Babel preset is a shareable list of plugins.

    The official Babel Stage presets tracked the TC39 Staging process for new syntax proposals in JavaScript.

    Each preset (ex. stage-3, stage-2, etc.) included all the plugins for that particular stage and the ones above it. For example, stage-2 included stage-3, and so on.

    The core idea is 'the ones above it'. I am not answer the second half as answers above are very good on that part.

提交回复
热议问题