Skip to content

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