Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Babel API #156

Open
coconilu opened this issue Mar 1, 2019 · 0 comments
Open

Babel API #156

coconilu opened this issue Mar 1, 2019 · 0 comments

Comments

@coconilu
Copy link
Owner

coconilu commented Mar 1, 2019

概述

Babel的作用是负责把原JS文件转变成目标文件,但是它并不能像webpack那样跟踪JS文件中引入的其它JS文件。所以,webpack和babel可以相辅相成完成我们的工作。

几个重要的概念

  1. CLI tool:通过命令行调用Babel
  2. Plugins 和 Presets,插件用于在处理抽象语法树的时候调用,preset是plugin的集合
  3. Configuration,可以定义Babel的行为
  4. Polyfill,译作垫片,可以让JS新特性运行在旧浏览器上

参考

Babel官方API文档
Babel Options
Babel 用户手册
Babel 插件手册
你真的会用 Babel 吗?
深入Babel,这一篇就够了
【JavaScript】深入理解Babel原理及其使用

@coconilu coconilu mentioned this issue Jun 23, 2020
68 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant