A brief talk about Babel#
What is Babel?#
Babel is a JavaScript compiler or a compilation converter from source code to target code.

As you can see from this picture,
Babelis divided into three stages, namelyparse(parsing),transform(conversion) andgenerate(generation).First, start from the
source codeon the far left, which is the code we write daily, which will be analyzed byparse. Thisparseprocess will perform some analysis such aslexical analysisandgrammatical analysison our code. The operation finally generates an abstract syntax tree calledAST.Then come to
transform, where the parsed content is processed according to the rules we specified and converted into a newASTabstract syntax tree.Then come to
generateand use our convertedASTabstract syntax tree to generate new code, which is the target code.
These are the approximate execution flow of Babel.