Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pdsuwwz/webpack-tree-shaking
Webpack Tree Shaking Demo
https://github.com/pdsuwwz/webpack-tree-shaking
pnpm pure-annotation tree-shaking webpack5
Last synced: 26 days ago
JSON representation
Webpack Tree Shaking Demo
- Host: GitHub
- URL: https://github.com/pdsuwwz/webpack-tree-shaking
- Owner: pdsuwwz
- License: mit
- Created: 2021-12-15T06:55:54.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-07T02:18:46.000Z (almost 2 years ago)
- Last Synced: 2024-11-03T13:52:51.102Z (2 months ago)
- Topics: pnpm, pure-annotation, tree-shaking, webpack5
- Language: JavaScript
- Homepage:
- Size: 164 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# webpack-tree-shaking
## Startup
检验 `tree shaking` 是否有效:
1. 第1次运行打包服务 `pnpm build`
2. 在 `main.js` 文件中仅有 `func-a` 模块,没有 `func-b` 模块
3. 此时将 `func-b.js` 中的注释 `/*#__PURE__*/` 去掉后第2次打包
4. 第2次打包后的 `main.js` 文件中均含有 `func-a` 和 `func-b` 模块以上,即可以证明 `tree shaking` 的有效性。