Skip to content

Commit

Permalink
Update rollup.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lingxyz authored May 8, 2023
1 parent 4a5b89d commit ccde0a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/web/rollup.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ rollup main.js --file bundle.js --format umd --name "myBundle"

# Tree-Shaking 优化

通过`依赖分析`,将实际`未使用的代码剔除`。粒度到`函数`级别。
通过`依赖分析`Rollup 将实际`未使用的代码剔除`。粒度到`函数`级别。

> `Tree-Shaking` 也叫`live code inclusion`,是一种消除无效代码的方式。根据项目依赖抽离模块内容的 `AST抽象语法树`,然后 `摇动语法树` 以删除所有无效代码,过程类似于 `标记-清除垃圾收集算法`
Expand All @@ -67,4 +67,4 @@ ajax(...);
// 对比在commonjs中,只能整体引入模块
const utils = require('./utils');
utils.ajax(...);
```
```

0 comments on commit ccde0a7

Please sign in to comment.