Babel

Babel是一个JavaScript编译器。(Babel is a JavaScript compiler.)

Github星跟蹤圖

Babel是编写下一代JavaScript的编译器。Babel是一种工具链,主要用于将ECMAScript 2015+代码转换为当前和旧版浏览器或环境中的向后兼容版本的JavaScript。

Babel是一个社区驱动的工具,可帮助您在最新版本的JavaScript中编写代码。

以下是Babel可以为您做的主要事情:

  • 转换语法
  • 目标环境中缺少的Polyfill功能(通过@ babel /polyfill)
  • 源代码转换(codemods)
  • 和更多! (看看这些视频的灵感)

当您支持的环境本身不支持某些功能时,Babel将帮助您将这些功能编译为受支持的版本。

In

//ES2015 arrow function[1, 2, 3].map((n) => n + 1);

Out

[1, 2, 3].map(function(n) {  return n + 1;});


概覽

名稱與所有者babel/babel
主編程語言TypeScript
編程語言JavaScript (語言數: 6)
平台
許可證MIT License
發布數849
最新版本名稱v8.0.0-alpha.8 (發布於 2024-04-04 13:08:30)
第一版名稱v1.7.7 (發布於 )
創建於2014-09-28 13:38:23
推送於2024-04-26 20:55:50
最后一次提交2020-06-17 15:32:46
星數42.9k
關注者數811
派生數5.6k
提交數16.3k
已啟用問題?
問題數8747
打開的問題數625
拉請求數5663
打開的拉請求數144
關閉的拉請求數1144
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?

Babel (pronounced "babble") is a community-driven project used by many companies and projects, and is maintained by a group of volunteers. If you'd like to help support the future of the project, please consider:

Sponsors

Our top sponsors are shown below! [Become a sponsor]















Intro

Babel is a tool that helps you write code in the latest version of JavaScript. When your supported environments don't support certain features natively, Babel will help you compile those features down to a supported version.

In

// ES2015 arrow function
[1, 2, 3].map((n) => n + 1);

Out

[1, 2, 3].map(function(n) {
  return n + 1;
});

Try it out at our REPL.

FAQ

Who maintains Babel?

Mostly a handful of volunteers, funded by you! Please check out our team page!

Is there a Babel song?

I'm so glad you asked: Hallelujah —— In Praise of Babel by @angus-c, audio version by @swyx. Tweet us your recordings!

Looking for support?

For questions and support please join our Slack Community (you can sign-up here for an invite), ask a question on Stack Overflow, or ping us on Twitter.

Where are the docs?

Check out our website: babeljs.io, and report issues/features at babel/website.

Want to report a bug or request a feature?

Please read through our CONTRIBUTING.md and fill out the issue template at babel/issues!

Want to contribute to Babel?

Check out:

Some resources:

How is the repo structured?

The Babel repo is managed as a monorepo that is composed of many npm packages.

License

MIT

去到頂部