-
背景
报错
然后场景是
|
Beta Was this translation helpful? Give feedback.
Answered by
yimingjfe
Jun 13, 2023
Replies: 1 comment 6 replies
-
前后端共用的代码,推荐放到 shared 目录下面:https://modernjs.dev/apis/app/hooks/shared.html |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
目前 BFF 还不支持 monorepo 下的源码开发,需要构建出对应的 cjs 产物,把被引用包的 package.json 中的
exports
中require
字段指向这份 cjs 产物(可参考:Conditional exports)。这里可以使用 Modern.js 的模块工程进行构建,Modern.js 的模块工程可以同时构建出 esm 和 cjs 的产物。(可参考 Modern.js 仓库下的包)