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

推荐使用ES6模块而不是commonjs规范 #134

Open
zhengwei1949 opened this issue May 10, 2018 · 0 comments
Open

推荐使用ES6模块而不是commonjs规范 #134

zhengwei1949 opened this issue May 10, 2018 · 0 comments

Comments

@zhengwei1949
Copy link
Owner

为什么ES模块比CommonJS更好?(Why are ES modules better than CommonJS modules?)
ES模块是官方标准,也是JavaScript语言明确的发展方向,而CommonJS模块是一种特殊的传统格式,在ES模块被提出之前做为暂时的解决方案。 ES模块允许进行静态分析,从而实现像 tree-shaking 的优化,并提供诸如循环引用和动态绑定等高级功能。

什么是 ‘tree-shaking’?(What is “tree-shaking?”)
Tree-shaking, 也被称为 “live code inclusion,” 它是清除实际上并没有在给定项目中使用的代码的过程,但是它可以更加高效。

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