icepkg icon indicating copy to clipboard operation
icepkg copied to clipboard

monorepo 仓库中Rax 组件打包报错

Open Nealyang opened this issue 3 years ago • 2 comments

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 中对依赖的引用也没有什么特殊处理。

error msg

dependencies

framework

另外,如果我到对应包内安装依赖,对应包即可正常开发和发布。

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 中(外层),组件可正常打包

Nealyang avatar Jul 21 '22 02:07 Nealyang

https://github.com/ice-lab/icepkg/blob/main/packages/plugin-docusaurus/src/plugin.js#L31

像是这里写死原因

Nealyang avatar Aug 05 '22 09:08 Nealyang

https://github.com/ice-lab/icepkg/blob/main/packages/plugin-docusaurus/src/plugin.js#L31

像是这里写死原因

恩,看着应该是这里了。可以尝试用 require.resolve() 改一下。另外你能提供可复现的 demo 么?

luhc228 avatar Jan 18 '23 09:01 luhc228