【问题标题】:Make Yarn don't hoist the dependencies of the specific package使 Yarn 不提升特定包的依赖项
【发布时间】:2021-09-15 09:29:04
【问题描述】:

在下面的项目中,我希望TodoList 的所有依赖项都不会托管到monorepo 根目录中的node_modules

以下设置不足以达到此效果:

{
  "private": true,
  "workspaces": {
    "packages": [ "BusinessRules", "Server", "TodoList" ],
    "nohoist": [
      "TodoList/**"
    ]
  }
}

"TodoList/**/**" 也不够用。

如何让TodoList的所有依赖都在TodoList/node_modules里面?

【问题讨论】:

    标签: node.js yarnpkg yarn-workspaces


    【解决方案1】:

    找到解决方案here

    在这种情况下,需要在TodoList/package.json下面添加JSON:

    "workspaces": {
        "nohoist": ["**"]
    },
    

    【讨论】:

      猜你喜欢
      • 2013-06-17
      • 2020-12-06
      • 2018-07-19
      • 1970-01-01
      • 1970-01-01
      • 2011-02-21
      • 1970-01-01
      • 2021-12-06
      • 2019-11-18
      相关资源
      最近更新 更多