当前位置:网站首页>JS (III) convert ES6 syntax to Es5 syntax
JS (III) convert ES6 syntax to Es5 syntax
2022-06-12 14:28:00 【Makasa】
Preface
This chapter is mainly about es6 The grammatical js, convert to es5 grammar
- Use scenarios : because Jmeter Top only fits es5 The grammatical js, The front end of a friend company is written es6 The grammatical js, In order to carry on Jmeter Is compatible with , Therefore, carry out relevant conversion
- Using tools :babel
- Premise :npm When the environment has been deployed
One 、 preparation
1、 Create folder

2、 Create in project root .babelrc file
{
"presets": [
"es2015"
],
"plugins": []
}

3、 Global installation babel Tools
3.1) install babel-cli
npm install -g babel-cli

3.2) install babel-cli es5 Syntax conversion package
npm install --save-dev babel-preset-es2015 babel-cli

3.3) Verify that the installation is successful
see C:\Users\Administrator\package.json file , Whether the dependency has been added 
4、 Terminal input command for conversion
- grammar :babel The path to be converted / --out-dir The path after conversion /)
cd C:\Users\Administrator\Desktop\DJ Working documents \es6_change_es5 # Switch to the project directory
babel es6 --out-dir es5 # Execute conversion command


边栏推荐
- [ROC] aspriseocr C # English, Digital identification (not Chinese)
- SystemC uses SC_ report_ Handler processing log printing
- Player practice 15 xdemux and avcodecparameters
- Postgresql14 installation and use tutorial
- 测试工程师如何转型测开
- Why do Chinese programmers change jobs?
- String concatenation and ternary operators
- [early knowledge of activities] list of recent activities of livevideostack
- 动态搜索广告智能查找匹配关键字
- 工业机械臂(机器人)视觉定位引导系统
猜你喜欢

华为设备配置BGP AS号替换

How to package QT program learning records with inno setup

Axi4 increase burst / wrap burst/ fix burst and narrow transfer

Reverse the encryption parameters of a hot water software

Recursive summary of learning function

动态搜索广告智能查找匹配关键字

chrome://tracing Performance analysis artifact

Ppt cannot be opened, always prompt how to fix it

Huawei equipment is configured with H virtual private network

Program analysis and Optimization - 6 loop optimization
随机推荐
基于Profibus-DP协议的PLC智能从站设计
QT database realizes page turning function
Introduction to functions (inline functions and function overloading)
SystemC learning materials
C secret arts script Chapter 2 (detailed explanation of pointer) (Section 2)
【OCR】AspriseOCR C# 英文、数字识别(中文不行)
高考回忆录
Pay attention to click and pursue more users to enter the website. What bidding strategy can you choose?
SystemC time
C語言中主函數調用另外一個函數,匯編代碼理解
String concatenation and ternary operators
C secret arts script Chapter 2 (detailed explanation of pointers) (Section 3)
Codeforces Round #798 (Div. 2)(A~D)
Vs2012: cannot assign a value of type 'char *' to an entity of type 'lpwstr'
Details of bypassing safeseh mechanism by using modules that do not enable safeseh
For cross-border e-commerce, the bidding strategy focusing more on revenue - Google SEM
如果要打造品牌知名度,可以选择什么出价策略?
高考回憶錄
En langage C, la fonction principale appelle une autre fonction et assemble le Code pour comprendre
How test engineers transform test and open