How do I import in a third-party react component library? #493
-
如题。如何引入第三方react组件库,如arco design、ant design等? |
Beta Was this translation helpful? Give feedback.
Answered by
sanyuan0704
Dec 31, 2023
Replies: 1 comment 4 replies
-
mdx 里面是可以引入 React 组件的,可以直接用 |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
首先「按需加载」 不等于「页面里面不用引入,可以直接使用组件」。
不过你说的这两个场景 Rspress 都支持,你可以通过
builderConfig.source.transformImport
来配置按需加载的插件,配置可以看 https://rsbuild.dev/config/source/transform-import。如果页面里面不引入直接使用组件,可以使用 Rspress 的
markdown.globalComponents
配置,文档:https://rspress.dev/zh/api/config/config-build.html#markdownglobalcomponents