arlyxiao / best-practice

1 stars 0 forks source link

Simple way to create monorepo with yarn #103

Open arlyxiao opened 1 year ago

arlyxiao commented 1 year ago

Create package.json file and packages folder in root folder.

Make sure you have the config

"private": true,
 "workspaces": [
    "packages/**",
  ],

Create common folder in packages folder

package.json

{
  "name": "@pm/common",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT"
}

index.ts

export function hello() {
  console.log('say hello');
  return 'hello';
}

Create ui folder in packages folder

More detail https://dev.to/kpiteng/yarn-workspaces-monorepo-approach-354o