Babel 中文文档
  • 印记中文
  • 文档
  • 配置
  • 试用
  • 视频
  • 博客
  • 赞助
  • 团队
  • GitHub

›杂项

指南

  • 什么是 Babel?
  • 使用指南
  • 配置 Babel
  • 学习 ES2015
  • 升级至 Babel 7

配置参考

  • 配置文件
  • Config Options
  • 预设
  • 插件
  • 插件列表
  • Compiler assumptions

预设

  • @babel/preset-env
  • @babel/preset-react
  • @babel/preset-typescript
  • @babel/preset-flow

杂项

  • 路线图
  • 注意事项
  • 新增特性时间轴
  • FAQ
  • 编辑器

集成包

  • @babel/cli
  • @babel/polyfill
  • @babel/plugin-transform-runtime
  • @babel/register
  • @babel/standalone

工具包

  • @babel/parser
  • @babel/core
  • @babel/generator
  • @babel/code-frame
  • @babel/runtime
  • @babel/template
  • @babel/traverse
  • @babel/types

帮助工具包

  • helper-compilation-targets
  • helper-module-imports
Edit

编辑器

Syntax Highlighting

Syntax Highlighting

These days, many popular editors support ES2015+ syntax highlighting out of the box, while some require installing additional extensions. This guide should help you get the syntax highlighting to work.

If you're looking for more advanced integrations, you may want to take a look at the Setup guide.

Tip: The font used on the screenshot above is FiraCode.

Atom

Install language-babel package and follow the instructions.

Sublime Text 3

First, install Package Control. Then install Babel package from the Package Control menu and follow the instructions.

Vim

Install the vim-javascript plugin, which brings both improved syntax highlighting and indentation support for JavaScript to Vim.

Another option is to use yajs.vim with es.next.syntax.

Visual Studio Code

Install the vscode-language-babel extension and follow the instructions.

There seems to be one other way to get the syntax highlighting working and you can learn more about it in the Visual Studio Code docs.

WebStorm

WebStorm now ships with support for ES2015+ without requiring the installation of any additional extensions. You may, however, need to enable it.

← FAQ@babel/cli →
  • Syntax Highlighting
    • Atom
    • Sublime Text 3
    • Vim
    • Visual Studio Code
    • WebStorm
Babel 中文文档
文档
学习 ES2015
社区
视频用户Stack OverflowSlack 频道Twitter
更多
博客GitHub 组织GitHub 仓库Website 仓库旧版网址 6.x旧版网址 5.x