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

tree shake #212

Open
wants to merge 21 commits into
base: dev
Choose a base branch
from
Open

tree shake #212

wants to merge 21 commits into from

Conversation

sparklinm
Copy link
Contributor

ES6 模块 tree shake 的实现,同时这里也尝试进行了 commonjs 的 tree shake。一个完整的 tree shake 过程分为以下两步:

  1. 跨文件分析导出模块是否被导入(已经实现)。
  2. 分析未被导入的导出模块是否在本文件内部使用(简单实现),但可以借助 terser 工具处理。

(类似于webpack 的 usedExports)

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

Successfully merging this pull request may close these issues.

2 participants