Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-study-front-share
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
yifu-study
front
yifu-study-front-share
Commits
019d58b5
Commit
019d58b5
authored
Mar 16, 2022
by
caihaifei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update.
parent
e84841b6
Pipeline
#15363
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
babel-basic.md
source/_posts/babel-basic.md
+2
-0
No files found.
source/_posts/babel-basic.md
View file @
019d58b5
...
...
@@ -8,6 +8,8 @@ date: 2022-03-15 15:58
前端项目工程化不断迭代更新,新的语法功能、特性让代码的书写变得更加舒服、简洁、易读、可维护。然而,对于浏览器的语法兼容性,却并不能很好的完美兼容新提出的语法、特性,不同版本的浏览器对于兼容语法方面也有着较大的差异。这时候,babel的出现可以说是应运而生,通过对于es2015+的语法进行编译适配,可以让我们更好的关注于业务本省、用最简洁的的代码完成需求,而不需要关注不同版本之间的兼容问题。Babel可以在不同测场景有着不同的使用,如下介绍的则是在cli(命令行)环境下,如何使用babel为我们的项目实现编译兼容。
<!-- more -->
1.
安装babel
```
$ npm init
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment