Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between babel-core and @babel/core?

What is the difference between babel-core and @babel/core ?

Are they the same thing but different versions? If not so, when do you use one and when do you use the other?

Thank you.

like image 532
YulePale Avatar asked Nov 19 '18 18:11

YulePale


People also ask

What is Babel core used for?

Babel is a JavaScript compiler Babel is a toolchain that is mainly used to convert ECMAScript 2015+ code into a backwards compatible version of JavaScript in current and older browsers or environments.

What Babel version am I using?

You can also check the version of babel-cli by finding the babel-cli folder in node_modules and looking at the version property of the package. json that is at the base of that folder. If babel-cli was installed globally via -g flag of npm install , you could check the version by executing command babel --version .

What is the latest version of Babel?

Babel 7.18 is released!

What is Babel polyfill?

Babel includes a polyfill that includes a custom regenerator runtime and core-js. This will emulate a full ES2015+ environment (no < Stage 4 proposals) and is intended to be used in an application rather than a library/tool. (this polyfill is automatically loaded when using babel-node ).

What is the difference between Babel-core and Babel package?

babel-core is the API. For v5 the babel package is the CLI and depends on babel-core. For v6, the babel-cli package is the CLI (the CLI bin command is still babel though) and the babel package doesn't do anything. babel-runtime I guess is just the runtime (polyfill and helpers) to support code that's already been transformed.

What is Babel-CLI in Node 3?

3 Answers. babel-cli, which contains the babel command line interface babel-core, which contains the Node API and require hook babel-polyfill, which when required, sets you up with a full ES2015-ish environment To avoid accidental conflicts, make sure to remove any previous Babel packages like babel, babel-core, etc.

What is the difference between Babel-clipackage and babelpackage?

For v5 the babelpackage is the CLI and depends on babel-core. For v6, the babel-clipackage is the CLI (the CLI bin command is still babelthough) and the babelpackage doesn't do anything.


1 Answers

Since Babel 7 the Babel team switched to scoped packages, so you now have to use @babel/core instead of babel-core.
But in essence, @babel/core is just a newer version of babel-core.

This is done to make a better distinction which packages are official and which are third-party.

like image 199
MichaelDeBoey Avatar answered Oct 21 '22 12:10

MichaelDeBoey