yarn icon indicating copy to clipboard operation
yarn copied to clipboard

How to change dependency installation directory at Yarn

Open erolyapici opened this issue 8 years ago • 5 comments

How to change dependency directory yarn package manager. yarn default install node_module but I want to install only "fred" library on public directory other library install node_modules directory. I added directories propery but it doesn't work package.json

{
  "name": "test",
  "title": "test",
  "description": "",
  "version": "1.0.1",
  "directories": {
    "fred":":public/"
  },
  "devDependencies": {
    "fred": "1.0.2"
  },
  "dependencies": {
    "sw-toolbox": "^3.4.0",
    "fred": "1.0.2"
  }
}

erolyapici avatar Jan 17 '18 12:01 erolyapici

As far as I know, there is no way to install some packages to different directories. @yarnpkg/core anyone know if this is a thing that is supported?

rally25rs avatar Jan 17 '18 21:01 rally25rs

--cwd was something @kittens suggested right?

Haroenv avatar Jan 18 '18 00:01 Haroenv

I read this but it doesn't work. https://yarnpkg.com/en/docs/package-json#toc-directories

erolyapici avatar Jan 18 '18 05:01 erolyapici

Thanks guys y'all rock

Keensyst avatar Jan 18 '18 10:01 Keensyst

The directories listing mentioned in there is for published packages if I understand it correctly, not to put packages in a certain folder.

Haroenv avatar Jan 18 '18 11:01 Haroenv