官术网_书友最值得收藏!

  • JavaScript:Moving to ES2015
  • Ved Antani Simon Timms Narayan Prusty
  • 174字
  • 2021-07-09 19:07:41

Transpilers

Transpiling is a technique that combines both compilation and transformation. The idea is to write ES6-compatible code and use a tool that transpiles this code into a valid and equivalent ES5 code. We will be looking at the most complete and popular transpiler for ES6 called Babel (https://babeljs.io/).

Babel can be used in various ways. You can install it as a node module and invoke it from the command line or import it as a script in your web page. Babel's setup is exhaustive and well-documented at https://babeljs.io/docs/setup/. Babel also has a great Read-Eval-Print-Loop (REPL). We will Babel REPL for most of the examples in this chapter. An in-depth understanding of various ways in which Babel can be used is out of the scope of this module. However, I would urge you to start using Babel as part of your development workflow.

We will cover the most important part of ES6 specifications in this chapter. You should explore all the features of ES6 if possible and make them part of your development workflow.

主站蜘蛛池模板: 内丘县| 阿拉善左旗| 富平县| 邵阳县| 沈丘县| 昌邑市| 汝南县| 海城市| 克拉玛依市| 永登县| 南川市| 亳州市| 景东| 永福县| 姜堰市| 陇南市| 无为县| 龙胜| 滨海县| 涪陵区| 根河市| 商南县| 灵丘县| 尼木县| 襄樊市| 拉萨市| 临沧市| 昌乐县| 剑河县| 唐河县| 华蓥市| 鸡泽县| 阿拉善盟| 武山县| 怀仁县| 信宜市| 九寨沟县| 安庆市| 肥城市| 怀集县| 浠水县|