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


边栏推荐
- Software package for optimization scientific research field
- Player actual combat 14 display YUV
- Dynamic search advertising intelligent search for matching keywords
- Leetcode 2176. 统计数组中相等且可以被整除的数对
- C secret arts script Chapter 2 (detailed explanation of pointers) (Section 3)
- OAuth2学习中的一些高频问题的QA
- Create a slice slice pit using the make method
- 高考回忆录
- For cross-border e-commerce, the bidding strategy focusing more on revenue - Google SEM
- C secret arts script Chapter 5 (paragraph) (Section 3)
猜你喜欢

chrome://tracing Performance analysis artifact

Player practice 18 xresample

New technology: efficient self-monitoring visual pre training, local occlusion no longer need to worry!

对某热水软件的加密参数逆向

C secret arts script Chapter 5 (paragraph) (Section 3)

QT realize picture dragging

Tlm/systemc: TLM socket binding problem

Redis核心配置和高级数据类型

浅谈中国程序员为什么要跳槽?

Player actual combat 22 to solve the problems of flower screen and Caton
随机推荐
程序分析与优化 - 6 循环优化
3. Hidden processes under the ring
QT realize picture dragging
Sizeof calculation space size summary
【OCR】AspriseOCR C# 英文、數字識別(中文不行)
Leetcode 2185. Counts the string containing the given prefix
Summary of virtual box usage problems
Solve the problem that IEEE latex template cannot display Chinese
使用make方法创建slice切片的坑
Pay attention to click and pursue more users to enter the website. What bidding strategy can you choose?
Markdown edit
C secret script Chapter 1: data storage (in-depth analysis)
Write policy of cache
Notepad common settings
In C language, the main function calls another function, which is understood by assembly code
通信流量分析
Implementation and debug of process hiding under x64
QT multi thread drawing and real-time refreshing method
Brush one question every day /537 Complex multiplication
Codeforces Round #798 (Div. 2)(A~D)