Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

last 2 versions 的含义 #78

Open
lovelmh13 opened this issue Jun 16, 2021 · 0 comments
Open

last 2 versions 的含义 #78

lovelmh13 opened this issue Jun 16, 2021 · 0 comments

Comments

@lovelmh13
Copy link
Owner

babel 的转换测试可以看官网这里:Try it out

.browserslistrc 有如下配置:

> 1% 
last 2 versions
not dead

当设置为总是要考虑最后两个版本的时候,总是会包括 ie ,所以 es6 的语法总是会转译成 es5(注意这里是说「语法」会被转,而不是新的 「api」,所以像 .flat 并不是通过配置 browserslistrc 来实现 polyfill 的,怎么实现的 api ,请看下一章

命令行使用: npx browserslist 'last 2 versions' 可以看到 'last 2 versions' 支持的浏览器版本
image

推荐阅读:
“last 2 versions” 之遗祸

browserslist 参考: browserslist-npm

端工程基础知识点--Browserslist (基于官方文档翻译)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant