vue-hooks-plus icon indicating copy to clipboard operation
vue-hooks-plus copied to clipboard

lodash-es推荐

Open zhangziyi123 opened this issue 8 months ago • 5 comments

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 avatar Jun 06 '24 03:06 zhangziyi123