'Different folders for npm and yarn
I coded a web application for which I use yarn for managing CSS and JavaScript dependencies. I decided to start using tools like parcel, sass, typescript, etc which I added as dev dependencies in my package.json file.
The package.json file is in the root folder, but my yarn-installed dependencies are in the /public/vendor/ folder, because anything outside the /public/ folder is not directly accessible to users. So I can't link the libraries in the /node_modules/ folder to my HTML.
Here is the content of my /.yarnrc file:
--modules-folder ./public/vendor --ignore-optional --production=true
The problem is that even though yarn will create its own yarn.lock file, it takes into account the contents of the package-lock.json file. So if a dependency has already been installed by npm, it won't be installed by yarn unless I explicitly declare it to be installed (meaning it works for dependencies, but not for dependency dependencies).
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
