Skip to content

"@antv/s2": "^2.1.5"和"@antv/s2-react": "^2.1.4",无法正常使用 #3054

Closed Answered by lijinke666
gb853940223 asked this question in Q&A
Discussion options

You must be logged in to vote

确保你的打包工具识别 package.jsonexportspeerDependenciesMeta 关键字, @antv/g2 是可选依赖, 只有使用 @antv/s2/extends 才需要, 看起来是你的打包工具不支持, 实在不行可以额外安装下 @antv/g2

  "exports": {
    ".": {
      "import": "./esm/index.js",
      "require": "./lib/index.js"
    },
    "./extends": {
      "import": "./esm/extends/index.js",
      "require": "./lib/extends/index.js"
    },
    "./*": "./*"
  },
  "peerDependencies": {
    "@antv/g2": ">=5.1.21"
  },
  "peerDependenciesMeta": {
    "@antv/g2": {
      "optional": true
    }
  },

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by gb853940223
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants