Skip to content

Monorepo下api里能否引用其他模块 #3934

Answered by yimingjfe
xmsz asked this question in Q&A
Discussion options

You must be logged in to vote

目前 BFF 还不支持 monorepo 下的源码开发,需要构建出对应的 cjs 产物,把被引用包的 package.json 中的 exportsrequire 字段指向这份 cjs 产物(可参考:Conditional exports)。

这里可以使用 Modern.js 的模块工程进行构建,Modern.js 的模块工程可以同时构建出 esm 和 cjs 的产物。(可参考 Modern.js 仓库下的包)

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@xmsz
Comment options

@chenjiahan
Comment options

@xmsz
Comment options

@yimingjfe
Comment options

Answer selected by chenjiahan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants