前端入门
来源:互联网 发布:淘宝指数在哪 编辑:程序博客网 时间:2024/05/18 01:59
#Babel
Babel 是一个 JavaScript 编译器。用来编译 jsx ES15 ES6的语法进行转换。
ES2015 and beyond
Babel has support for the latest version of JavaScript through syntax transformers. These plugins allow you to use new syntax, right now without waiting for browser support. Check out our env preset to get started
you can install this preset with:
npm install --save-dev babel-preset-env
Polyfill
Since Babel only transforms syntax (like arrow functions), you can use babel-polyfill in order to support new globals such as Promise or new native methods like String.padStart (left-pad). It uses core-js and regenerator. Check out our babel-polyfill docs for more info.
npm install --save-dev babel-polyfill
JSX and Flow
Babel can convert JSX syntax and strip out type annotations. Check out our React preset to get started. Use it together with the babel-sublime package to bring syntax highlighting to a whole new level.
npm install --save-dev babel-preset-react
Babel CLI
While you can install Babel CLI globally on your machine, it’s much better to install it locally project by project.
There are two primary reasons for this.
Different projects on the same machine can depend on different versions of Babel allowing you to update one at a time.
It means you do not have an implicit dependency on the environment you are working in. Making your project far more portable and easier to setup.
We can install Babel CLI locally by running:
npm install --save-dev babel-cli
- 【前端入门】前端基本概念
- 前端入门
- 前端入门
- 前端入门
- 前端开发入门:less入门
- 前端开发入门心得
- 前端jQuery组件入门
- 前端技术入门
- [前端] nodejs入门[浅入深出]
- [前端] 日历入门写法
- [前端] grunt入门
- 前端入门方法总结
- 前端开发入门:AngularJS
- 前端零基础入门
- 前端入门相关工具
- 前端入门经验
- 前端性能优化入门
- 前端入门DAY1-html
- 2017年8月19日训练日记
- 后缀自动机学习小结
- C++11:互斥量
- C++11 auto类型说明符如for(atuo &x : s)
- Struts2学习笔记(三)
- 前端入门
- In-app billing 接入流程和坑点
- 选择
- nginx tomcat
- Android Studio如何快速生成get,set,tostring,构造函数
- .SMTPDataError: 554, 'DT:SPM
- hdu-6122 Color the chessboard 思维
- 用jsp处理404错误
- 类的实例化带括号与不带括号的区别