惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hugging Face - Blog
Hugging Face - Blog
Microsoft Azure Blog
Microsoft Azure Blog
月光博客
月光博客
S
Securelist
J
Java Code Geeks
Recorded Future
Recorded Future
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
M
MIT News - Artificial intelligence
S
Secure Thoughts
Y
Y Combinator Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
Docker
Martin Fowler
Martin Fowler
The Last Watchdog
The Last Watchdog
WordPress大学
WordPress大学
The GitHub Blog
The GitHub Blog
Vercel News
Vercel News
O
OpenAI News
www.infosecurity-magazine.com
www.infosecurity-magazine.com
博客园_首页
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
PCI Perspectives
PCI Perspectives
N
News and Events Feed by Topic
H
Heimdal Security Blog
SecWiki News
SecWiki News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
博客园 - 【当耐特】
T
Troy Hunt's Blog
L
LINUX DO - 最新话题
Hacker News: Ask HN
Hacker News: Ask HN
Hacker News - Newest:
Hacker News - Newest: "LLM"
N
Netflix TechBlog - Medium
A
Arctic Wolf
The Hacker News
The Hacker News
I
Intezer
S
Schneier on Security
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Apple Machine Learning Research
Apple Machine Learning Research
L
Lohrmann on Cybersecurity
宝玉的分享
宝玉的分享
P
Privacy & Cybersecurity Law Blog
Stack Overflow Blog
Stack Overflow Blog
T
Tor Project blog
小众软件
小众软件
Simon Willison's Weblog
Simon Willison's Weblog
The Cloudflare Blog
Jina AI
Jina AI

博客园 - follaw

知识点记录 websocket 入门 30分钟学会JS AST,打造自己的编译器 js 浅拷贝有大用 这么多小程序,会微信小程序就够了 2019年-感谢一路相随 2019年学习以及输出计划 不要让自己的技能沦为大众化 新年福利-领取2019前端学习资料和电子书 事件循环进阶:macrotask与microtask 放弃setInterval-说说定时器 从Event Loop谈JS的运行机制 css加载是否会阻塞dom树渲染 简单理解下浏览器渲染页面流程 浏览器内核中各个线程之间的关系 Browser进程和浏览器内核(Renderer进程)的通信过程 mac nvm install 小程序云开发补充 浏览器内核-渲染进程
babel 的一些记录
follaw · 2018-09-28 · via 博客园 - follaw

babel 的作用是将高版本的代码转换成低版本的可支持的代码;

过程是 读取 source code 转换为语法树 -》 经过处理 -》 转换为 code;

babel有preset和plugin,有啥作用和区别呢?

babel的代码的转换处理是通过plugin转换的,多个plugin执行顺序是从上到下;

presets是plugin的集合,不需要挨个的去写plugin了;

  • Plugin 会运行在 Preset 之前。
  • Plugin 会从第一个开始顺序执行。ordering is first to last.
  • Preset 的顺序则刚好相反(从最后一个逆序执行)。

babel的配置

是一个json结构,字段有presets和plugin ;

也支持env环境设置,是从process.env.BABEL_ENV 进行读取当前的环境变量,默认是development

{
    "env": {
        "production": {
            "presets": ["env","react"]
        },
        "development":{
            "presets": [
                "env",
                "react"
            ]
        }
    }
}

  待续。。。。。。