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

lodash-es推荐 #211

Open
4 tasks done
zhangziyi123 opened this issue Jun 6, 2024 · 5 comments
Open
4 tasks done

lodash-es推荐 #211

zhangziyi123 opened this issue Jun 6, 2024 · 5 comments
Labels
good issue good issue

Comments

@zhangziyi123
Copy link

Description

Lodash官方提供了ES Module版本的lodash: lodash-es, 给我们导入lodash模块,Tree Shaking就可以生效,其他没用到的代码打包的时候就可以自动移除掉了。

Suggested solution

写法如下:
原来写法:import debounce from "lodash/debounce"
改后:import { debounce } from "lodash-es"
打包大小是差不多,就是写法上的区别,后者更方便一点。

Alternative

No response

Additional context

No response

Validations

@zhangziyi123 zhangziyi123 added the enhancement: pending triage issue pending triage label Jun 6, 2024
@NelsonYong NelsonYong added good issue good issue and removed enhancement: pending triage issue pending triage labels Jun 7, 2024
@NelsonYong
Copy link
Contributor

@zhangziyi123 我会在近期将 lodash 改外 es

@NelsonYong
Copy link
Contributor

@XiaoDaiGua-Ray help , 有空帮忙搞搞

@XiaoDaiGua-Ray
Copy link
Contributor

XiaoDaiGua-Ray commented Jun 29, 2024 via email

XiaoDaiGua-Ray added a commit to XiaoDaiGua-Ray/vue-hooks-plus that referenced this issue Jun 30, 2024
XiaoDaiGua-Ray added a commit to XiaoDaiGua-Ray/vue-hooks-plus that referenced this issue Jun 30, 2024
@inhiblab
Copy link
Contributor

lodash-es 会影响我当前 vitepress 的构建,麻了 @XiaoDaiGua-Ray @zhangziyi123

@inhiblab
Copy link
Contributor

vitepress 内部会 require vhp,lodash-es 不支持 common js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good issue good issue
Projects
None yet
Development

No branches or pull requests

4 participants