Yarn Workspace + ReasonML: How to get bucklescript to resolve hoisted node modules?


#1

Hi all,

I’m trying to setup a monorepo using yarn workspaces with multiple reason projects. I’d like to make use of yarn’s node_modules hoisting feature.

So far my structure looks like this:

packages/
  - app-one/
    ...
    - package.json
    - bsconfig.json
  - ui-components/
    ...
    - package.json
    - bs-config.json

app-one/bsconfig.json declares bs-dependencies as follows:

  bs-dependencies": ["bs-css", "reason-react"]

These dependencies are also listed in <root>/packages/app-one/package.json

Due to yarn’s dependency hoisting, when I run yarn install at root, bs-css and reasonreact get installed to <root>/node_modules

So when I run bsb -make-world, bsb can’t find bs-css or reason-react.

This makes sense to me since bsb is looking for those dependencies in <root>/packages/app-one/node_modules and doesn’t see /node_modules.

Is there anyway I can get bsb to recognize the hoisted dependencies? Or is there another way to setup this project to get things to build correctly?