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

【Webpack】Tree Shaking #45

Open
Tracked by #6
swiftwind0405 opened this issue Apr 17, 2020 · 1 comment
Open
Tracked by #6

【Webpack】Tree Shaking #45

swiftwind0405 opened this issue Apr 17, 2020 · 1 comment
Labels

Comments

@swiftwind0405
Copy link
Owner

swiftwind0405 commented Apr 17, 2020

Tree Shaking 通常用于描述移除 js 中未使用的代码

  • Tree Shaking 只适用于ES Module语法(既通过export导出,import引入),因为它依赖于ES Module的静态结构特性。

  • Tree Shaking 只在生产环境下才会无效,因为在开发环境下由于 source-map 等相关因素的影响,如果不把没有使用的代码一起打包进来的话,source-map 就不是很准确,会影响我们本地开发的效率

@swiftwind0405
Copy link
Owner Author

swiftwind0405 commented Apr 17, 2020

@swiftwind0405 swiftwind0405 changed the title Webpack之tree shaking 【Webpack】【进阶】tree shaking Apr 17, 2020
@swiftwind0405 swiftwind0405 changed the title 【Webpack】【进阶】tree shaking 【Webpack】【进阶】Tree Shaking Apr 18, 2020
@swiftwind0405 swiftwind0405 changed the title 【Webpack】【进阶】Tree Shaking 【Webpack】Tree Shaking Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant