3

my project got the following structure

project-root
- common-modules
    - build-modules
        - packageA
        - packageB
    - packageC
    - packageD
- services
    - packageE -> needs packageA, packageC / devDependency on packageD
    - packageF -> needs packageB, packageC / devDependency on packageD

Each package and the project-root have a package.json with all the defined dependencies and devDependencies.

What is the right way to configure my project with yarn workspaces?

I don't want a single node_modules folder in each package, but one in the project-root.

Setting the package.json in the project-root up with

"workspaces": [
    "common-modules/build-modules/*", 
    "common-modules/packageC",
    "common-modules/packageD",
    "services/*"
]

did not work, because I could not even build packageE since the gulp-script could not require a devDependency.

tk421
  • 5,775
  • 6
  • 23
  • 34
svennergr
  • 800
  • 1
  • 8
  • 26
  • I'm not sure how gulp works. But since you are using yarn workspaces then adding dependencies for packageE would be the command `yarn workspace packageE add packageA@^1.0` and `yarn workspace packageE add packageC@^1.0`. Just replace the example version numbers with the correct ones. – Isaac Pak Nov 17 '18 at 01:48

0 Answers0