This is an example setup of Meteor apps in a Yarn Workspaces environment.
The Meteor apps are scaffolded with meteor create --minimal
and use Svelte with the help of zodern:melte.
I wanted to include Svelte in this example, since it's notorius for being accidentally bundled in multiple different versions and causing all kinds of trouble when the compiled version and included runtime don't match.
- Create
package.json
in the root of your monorepo - Add all packages and Meteor apps to workspace
"workspaces": [
"packages/**",
"app1",
"app2"
],
- Define a "never hoist anything"
nohoist
-rule inpackage.json
of all Meteor apps in the monorepo
"workspaces": {
"nohoist": [
"**"
]
},
- Run
yarn install
in the root of your monorepo - That's it!
If you encounter problems or have ideas for improvement, I'm all ears.
- Clone
- Make sure you have
yarn
installed - Run
yarn install
in monorepo root cd app1 && meteor
orcd app2 && meteor