react-component / react-component/util

father 默认兼容 ie11 导致构建尺寸偏大

Open
#531 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
670
Forks
205
Avg merge
11d 17h
Merged PRs (30d)
4

Description

根据 father 的文档 https://github.com/umijs/father/blob/master/docs/config.md#targets 使用 babel 构建默认兼容 ie11,导致产物体积偏大(尤其是 @babel/runtime 引入的很多)。而 antd 5 是不支持 ie 的,这些 polyfill 就显得不是很必要。是否可以考虑将 targets 改为 { chrome: 86 } 之类的现代浏览器配置?

经过我的测试,可以将 rc-util 的 bundle 体积从 2.8kB 减少到 1.7kB (minified + gzipped)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the targets section in father’s config documentation and inspect how rc-util’s build currently applies the default IE11 target. Compare a modern-browser target such as Chrome 86 with the current output, including the minified and gzipped bundle size. Done means the target choice is defined and the reported bundle-size reduction is verified without changing the intended build behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
babel, typescript
Domain
build-system, performance
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.