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

[Feature]减小包体积 #341

Closed
suanmei opened this issue Apr 26, 2021 · 4 comments
Closed

[Feature]减小包体积 #341

suanmei opened this issue Apr 26, 2021 · 4 comments
Assignees

Comments

@suanmei
Copy link
Collaborator

suanmei commented Apr 26, 2021

期望的新功能

减小包体积

为什么(简述一下使用场景)

现在的form-render压缩后还有1M。

突破点

moment.js 换成 dayjs
lodash 换成 lodash-es

@suanmei suanmei changed the title [Feature] [Feature]减小包体及 Apr 26, 2021
@suanmei suanmei changed the title [Feature]减小包体及 [Feature]减小包体积 Apr 26, 2021
@FateRiddle
Copy link
Contributor

嗯,moment会进行替换。lodash这个问题,感觉开发的大多数中后台项目都明着或者暗着(依赖包的依赖包)引用了lodash,这块改成lodash-es反而会给不少的项目增加体积。

@suanmei
Copy link
Collaborator Author

suanmei commented Apr 27, 2021

那是他们项目本身的问题。form-render 换成 lodash-es 后和 lodash 有关的代码会很少,相关代码体积小,即使旧有项目使用lodash也无所谓。而且lodash-es取代lodash也是趋势

@F-loat
Copy link
Collaborator

F-loat commented May 8, 2021

moment 的问题是不是通过 antd-dayjs-webpack-plugin 这个插件就可以解决,而且可以避免同时打入 dayjs 和 moment 两个时间库

@FateRiddle
Copy link
Contributor

@F-loat 确实可以哈,我下个版本优化一下。v1.3.1 已经做了lodash -> lodash-es 替换

@FateRiddle FateRiddle mentioned this issue May 10, 2021
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants