dcloudio / dcloudio/uni-ui

uni-data-picker 和 uni-data-pickerview 打包编译后占用了 290kb 的大小

Open
#968 2 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
2.1k
Forks
661
PR merge metrics
No merged PRs in 30d

Description

## 版本
@dcloudio/uni-ui: "1.5.7"
编译目标: 微信小程序
node: "14.21.2"
npm: 6.14.17
系统: Windows 10 22H2

## 问题
我只是在页面上引用了 `uni-data-picker` 组件,代码如下
```template

```
```js
data() {
return {
workOrderType: [],
taskSubTypeId: '',
}
}
```

然后,当我打包编译后大小是 **2.13MB**;
最后,我把这个组件从页面上删除使用后,打包编译后大小是 **1.84MB**。

## 问题原因
这对于主包总体积不能超过 2MB 的要求来说,这个组件占用了 296kb 影响了我打包后的小程序的总体积的。

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the reported 微信小程序 build with @dcloudio/uni-ui 1.5.7, comparing the page with and without uni-data-picker and uni-data-pickerview. Trace the generated bundle to identify why the component adds about 296kb; done means reducing unnecessary output while preserving the component's behavior and staying within the main-package size limit.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.