icepkg
icepkg copied to clipboard
monorepo 仓库中Rax 组件打包报错
Do you want to request a feature or report a bug? bug What is the current behavior?
背景:icepkg 在 monorepo 仓库中初始化 rax 组件,依赖管理使用 yarn。依赖安装于 workspace,在执行对应包内的 start 命令报错如下:找不到 react/jsx-runtime 依赖。实则此依赖在项目中已安装,只不过不是在包内的 node_modules 中按照的。比较费解,看了下@ice/pkg-plugin-docusaurus 中对依赖的引用也没有什么特殊处理。



另外,如果我到对应包内安装依赖,对应包即可正常开发和发布。
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
- Iceworks CLI version:
- Node verson:16.14.1
- Platform:MacOS
- tnpm version:9.1.6
- npm version:8.14.0
What is the expected behavior? 依赖安装在 workspace 中(外层),组件可正常打包
https://github.com/ice-lab/icepkg/blob/main/packages/plugin-docusaurus/src/plugin.js#L31
像是这里写死原因
https://github.com/ice-lab/icepkg/blob/main/packages/plugin-docusaurus/src/plugin.js#L31
像是这里写死原因
恩,看着应该是这里了。可以尝试用 require.resolve() 改一下。另外你能提供可复现的 demo 么?