简体   繁体   English

为什么需要@ babel-core

[英]Why need @babel-core

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

From the official babel docs : 来自官方的Babel文档

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. Babel是一个工具链,主要用于在当前和较旧的浏览器或环境中将ECMAScript 2015+代码转换为JavaScript的向后兼容版本。

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. 这意味着您可以使用某些浏览器不兼容的版本编写代码,然后babel转换代码以使这些浏览器“了解”它。 This process of conversion is called compiling. 这种转换过程称为编译。

From the official babel docs : 来自官方的Babel文档

Babel comes with a built-in CLI which can be used to compile files from the command line. Babel带有内置CLI,可用于从命令行编译文件。

This means that @babel-cli comes inside of @babel-core. 这意味着@ babel-cli位于@ babel-core内部。 It is a tool that helps you work with babel. 它是帮助您使用Babel的工具。 It helps you compile you code using the command line interface. 它可以帮助您使用命令行界面来编译代码。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 找不到模块“ babel-core”,但已安装@ babel / core - Cannot find module 'babel-core' but @babel/core is installed 'babel-core / register'vs'babel-register' - 'babel-core/register' vs 'babel-register' 如何从babel-core中取出转译的字符串? - How do I get the transpiled string out of babel-core? 在 package.json 文件中包含“@babel/core”和“babel-core”有什么区别? - What's the difference between having "@babel/core" and "babel-core" in your package.json file? babel-cli vs babel-preset-es2015 vs babel-register vs babel-core? - babel-cli vs babel-preset-es2015 vs babel-register vs babel-core? ERROR in找不到模块'babel-core'。使用react.js,webpack和express服务器 - ERROR in Cannot find module 'babel-core'. using react.js, webpack, and express server 如何使用babel-core / register在node.js中编写ES6代码? - How to use babel-core/register for writing ES6 code in node.js? “加载程序Users / abc / node_modules / babel-core / index.js中的错误?{” presets”:[“ react”]}未返回函数” - “ERROR in loader Users/abc/node_modules/babel-core/index.js?{”presets“:[”react“]} didn't return a function ” reactjs无法读取https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.js:37752:65 - reactjs can't read https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.js:37752:65 模块构建失败(来自./node_modules/babel-loader/lib/index.js):错误:找不到模块'babel-core' - Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Cannot find module 'babel-core'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM