简体   繁体   中英

Why need @babel-core

我是Babel和JS的新手,我想知道何时以及为什么使用@ babel-core软件包而不是@ babel-cli

From the official babel docs :

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.

This means that you can write your code in a version that is not compatible in some browsers then babel convert you code to make those browsers 'understand' it. This process of conversion is called compiling.

From the official babel docs :

Babel comes with a built-in CLI which can be used to compile files from the command line.

This means that @babel-cli comes inside of @babel-core. It is a tool that helps you work with babel. It helps you compile you code using the command line interface.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM