pdf文档 BabelJS Tutorial

2.70 MB 173 页 0 评论
语言
英语
格式
.pdf
评分
3
摘要
BabelJS i BabelJS i About the Tutorial BabelJS is a JavaScript transpiler which transpiles new features into old standard. With this, the features can be run on both old and new browsers, hassle-free. Babeljs comes with a wide range of features in the form of plugins, presets, polyfills, etc. In short, Babeljs is a toolset which has all the required tools available with it and which helps the developers to use all the current features available in ECMA Script and yet not worry how it will be supported on browsers. Audience This tutorial is designed for software programmers who want to learn the basics of BabelJS and its programming concepts in simple and easy ways. This tutorial will give you enough understanding on various functionalities of BabelJS with suitable examples. Prerequisites Before proceeding with this tutorial, you should have a basic understanding of JavaScript. Copyright & Disclaimer  Copyright 2018 by Tutorials Point (I) Pvt. Ltd. All the content and graphics published in this e-book are the property of Tutorials Point (I) Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or republish any contents or a part of contents of this e-book in any manner without written consent of the publisher. We strive to update the contents of our website and tutorials as timely and as precisely as possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt. Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of our website or its contents including this tutorial. If you discover any errors on our website or in this tutorial, please notify us at contact@tutorialspoint.com BabelJS ii Table of Contents About the Tutorial ............................................................................................................................................ i Audience ........................................................................................................................................................... i Prerequisites ..................................................................................................................................................... i Copyright & Disclaimer ..................................................................................................................................... i Table of Contents ............................................................................................................................................ ii 1. BabelJS — Overview ................................................................................................................................. 1 Why BabelJS?................................................................................................................................................... 1 What is Babel-Transpiler?................................................................................................................................ 2 What is Babel-polyfill? ..................................................................................................................................... 2 Features of BabelJS .......................................................................................................................................... 3 Advantages of using BabelJS ........................................................................................................................... 4 Disadvantages of using BabelJS ....................................................................................................................... 4 2. BabelJS — Environment Setup .................................................................................................................. 6 NodeJS ............................................................................................................................................................. 6 3. Babel — CLI ............................................................................................................................................... 9 4. BabelJS — ES6 Code Execution ................................................................................................................ 15 5. BabelJS — Project setup using Babel 6 .................................................................................................... 20 Create Project Setup ...................................................................................................................................... 20 6. BabelJS — Project Setup Using Babel 7 ................................................................................................... 27 7. BabelJS — Transpile ES6 features to ES5 ................................................................................................. 30 Let + Const ..................................................................................................................................................... 30 Const .............................................................................................................................................................. 32 Arrow Functions ............................................................................................................................................ 33 Classes ........................................................................................................................................................... 34 Promises ........................................................................................................................................................ 36 Generators ..................................................................................................................................................... 38 BabelJS iii Iterators .....
来源 www.tutorialspoint.com
BabelJS Tutorial 第2页
BabelJS Tutorial 第3页
下载文档到本地,方便使用
共 173 页, 还有 5 页可预览, 继续阅读
文档评分
请文明评论,理性发言.