dendog
dendog

Reputation: 3338

Multiple Vue apps, shared components in a monorepo

We have two key user types for our system, and we would like to break out the apps into two separate folders in a single repo. The idea then would be to have a shared components lib which both projects could use.

I am looking for some guidance on the best practice for how to achieve such a setup, ideally we can satisfy the following:

Upvotes: 6

Views: 791

Answers (1)

svenema
svenema

Reputation: 2556

I have limited experience, but it seems that for pnpm a common setup is:

mkdir <repo-name>
cd <repo-name>
pnpm init
mkdir packages
mkdir apps

pnpm-workspace.yaml

packages:
  - "packages/**"
  - "apps/**"

.npmrc

shamefully-hoist=true

.gitignore

node_modules

package.json

Rename the name to this format: "name":"@<repo-name>/root"

Applications go into the "apps" folder, reusable packages en components go into the "packages" folder.

I cannot comment on storybook.

Upvotes: 1

Related Questions