Skip to content

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

Open
@afc163

Description

@afc163

目前是写死的,容易和应用自身的 @babel/runtime 依赖声明产生多版本,增加不必要的体积:

"@babel/runtime": "7.23.6",

比如这里: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 本身好像没出现过问题,是否有必要锁死?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions