Is it possible to support the installation method of npm install --omit=optional? #8764
filefoxper
started this conversation in
Ideas
Replies: 1 comment
-
See #8762 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
在一些大型项目中,有大量只服务于开发过程的包,通常会被开发团队放在 optionalDependencies 中。在生产环境使用 npm install --omit=optional 的安装方式可以忽略这些只服务于开发过程的包。而 npm install --omit 并没有提供针对个别包的豁免权,这会导致 @rspack/binding 无法正常安装核心包的问题(因为核心包是放在 @rspack/binding/package.json 的 optionalDependencies 中的)。
思路:可以学习一下 esbuild ,在@rspack/binding 包的 package.json 中加入 postinstall 脚本,在安装完毕时,检查并补全缺失的包。希望可以支持一下,谢谢。
Beta Was this translation helpful? Give feedback.
All reactions