How to change Yarn default packages directory?

后端 未结 3 1734
抹茶落季
抹茶落季 2021-02-04 00:18

When Yarn is used to install dependencies, it puts them in node-modules directory by default.

How can I change this to i.e Laravel resources fo

3条回答
  •  心在旅途
    2021-02-04 01:09

    According to Yarn Docs, you can specify directories in package.json file

    {
      "directories": {
        "lib": "path/to/lib/",
        "bin": "path/to/bin/",
        "man": "path/to/man/",
        "doc": "path/to/doc/",
        "example": "path/to/example/"
      }
    }
    

    When installing your package, you can specify exact locations to put binary files, man pages, documentation, examples, etc.

提交回复
热议问题