当前位置:网站首页>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


边栏推荐
- How to package QT program learning records with inno setup
- [MySQL] basic database operation
- Copy word content to excel and automatically divide it into multiple columns
- Two methods of implementing asynchronous calling function with QT
- C secret script Chapter 3 (detailed explanation of string function) (Section 2)
- Player actual combat 14 display YUV
- Lua callinfo structure, stkid structure resolution
- SystemC simulation scheduling mechanism
- Socket model of punctual atom stm32f429 core board
- 基于Profibus-DP协议的PLC智能从站设计
猜你喜欢

Detailed explanation of C language memset

【活动早知道】LiveVideoStack近期活动一览

In C language, the main function calls another function, which is understood by assembly code

En langage C, la fonction principale appelle une autre fonction et assemble le Code pour comprendre

Lua callinfo structure, stkid structure resolution

Player practice 20 audio thread and video thread

Tlm/systemc: TLM socket binding problem

Leetcode 2176. 统计数组中相等且可以被整除的数对

Software package for optimization scientific research field
![[OCR] aspriseocr C # English, number recognition (not Chinese)](/img/80/198145df663d2eeec6b8b1d7bc47b6.png)
[OCR] aspriseocr C # English, number recognition (not Chinese)
随机推荐
【OCR】AspriseOCR C# 英文、数字识别(中文不行)
华为设备配置OSPF伪连接
IAT hook hijacking process API call
浅谈中国程序员为什么要跳槽?
Detailed explanation of C language memset
OAuth2学习中的一些高频问题的QA
Nesting of C language annotations
基于Profibus-DP协议的PLC智能从站设计
【OCR】AspriseOCR C# 英文、數字識別(中文不行)
Shell脚本到底是什么高大上的技术吗?
PMP agile knowledge points
Design of PLC intelligent slave station based on PROFIBUS DP protocol
Common DOS commands
Machine learning learning notes
Solve the problem that IEEE latex template cannot display Chinese
高考回憶錄
Lua callinfo structure, stkid structure resolution
工业机械臂(机器人)视觉定位引导系统
chrome://tracing Performance analysis artifact
Dynamic search advertising intelligent search for matching keywords