umijs / dumi

📖 Static Site Generator for component library development
https://d.umijs.org
MIT License
3.51k stars 1.17k forks source link

bug: dumi组件中使用dumi提供的api构建组件后在项目中引入报错 #2114

Closed QDyanbing closed 2 months ago

QDyanbing commented 2 months ago

Version

2.3.4

OS Version

macOS 14.4.1

Node.js Version

v16.20.1

Browser Version

chrome 124.0.6367.202

Link to minimal reproduction

https://github.com/QDyanbing/bug-repro-dumi-missing-dependencies

Steps to reproduce

image

组件中如果使用的dumi提供的方法构建出的组件在项目中使用时会报错

What is expected?

能正常使用

What is actually happening?

引入组件报错

Any additional comments? (optional)

No response

QDyanbing commented 2 months ago
image

这个是构建好的组件的源码,这个组件已上传到npm

PeachScript commented 2 months ago

组件库源码不应该依赖框架,API 文档已有提示:https://d.umijs.org/theme/api#api