umijs / umi

A framework in react community ✨
https://umijs.org
MIT License
15.43k stars 2.66k forks source link

@babel/runtime 版本是否可以改为 7.x? #12803

Open afc163 opened 4 days ago

afc163 commented 4 days ago

目前是写死的,容易和应用自身的 @babel/runtime 依赖声明产生多版本,增加不必要的体积:https://github.com/umijs/umi/blob/9c76d40101bffb69178cc53b5fa78a1abc7059db/packages/babel-preset-umi/package.json#L24

比如这里:https://github.com/ant-design/x/actions/runs/12002837217/job/33455385061?pr=229

error - Error: @babel/runtime
  Multiple versions of @babel/runtime found:
    7.23.6 ./~/@umijs/babel-preset-umi/~/@babel/runtime from ./components/sender/index.tsx
    7.26.0 ./~/@babel/runtime from ./~/rc-util/lib/pickAttrs.js

Check how you can resolve duplicate packages: 
https://github.com/darrenscerri/duplicate-package-checker-webpack-plugin#resolving-duplicate-packages-in-your-bundle

    at /home/runner/work/x/x/node_modules/@madccc/duplicate-package-checker-webpack-plugin/lib/index.js:187:18
    at Array.map (<anonymous>)
    at /home/runner/work/x/x/node_modules/@madccc/duplicate-package-checker-webpack-plugin/lib/index.js:169:27
    at _next0 (eval at create (/home/runner/work/x/x/node_modules/@umijs/bundler-utils/compiled/tapable/index.js:1:7744), <anonymous>:8:1)
    at eval (eval at create (/home/runner/work/x/x/node_modules/@umijs/bundler-utils/compiled/tapable/index.js:1:7744), <anonymous>:23:1)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
error: script "compile" exited with code 1
Error: Process completed with exit code 1.

@babel/runtime 本身好像没出现过问题,是否有必要锁死?

Jinbao1001 commented 4 days ago

let me cc