Should I use yarn workspaces on production?

Viewed 856

Me and a coworker are working on the deploy of some APIs that have some sharedlibs in common. The thing is, he said that workspaces shouldn't be used in production, but no reason was presented to defend that. I came with the following setup:

  • Set SSH Keys from the remote for pull the repository
  • Run yarn workspace <api-name> install for a single API
  • Run yarn build for ES6/Babel
  • Run API from dist folder. And we're done. No need for bash scripts or NPM private packages.
1 Answers

I see nothing wrong with your setup. Yarn Workspaces is used to simplify management tasks on your code tree (and I see install script as code). It does not really matters whether you run yarn workspace <api-name> install or cd <api-name>; ./install.sh - but the former is less error-prone.

Related