Skip to content

How do I import in a third-party react component library? #493

Answered by sanyuan0704
allen0234 asked this question in Q&A
Discussion options

You must be logged in to vote

首先「按需加载」 不等于「页面里面不用引入,可以直接使用组件」。

不过你说的这两个场景 Rspress 都支持,你可以通过 builderConfig.source.transformImport 来配置按需加载的插件,配置可以看 https://rsbuild.dev/config/source/transform-import。

如果页面里面不引入直接使用组件,可以使用 Rspress 的 markdown.globalComponents 配置,文档:https://rspress.dev/zh/api/config/config-build.html#markdownglobalcomponents

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@allen0234
Comment options

@sanyuan0704
Comment options

@allen0234
Comment options

@sanyuan0704
Comment options

Answer selected by sanyuan0704
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