monorepo-workspace

React, React-Native 동시 관리 및 build 환경

Usage no npm install needed!

<script type="module">
  import monorepoWorkspace from 'https://cdn.skypack.dev/monorepo-workspace';
</script>

README

3o3 monorepo workspace

React, React-Native 동시 관리 및 build 환경

[Environment]

monorepo 구조

- workspaces
  ├── components // Just component with styling
  ├── contaienrs // home, post layout
  ├── packages
  │    ├── app (REACT-NATIVE)
  │    ├── common (공통 모듈)
  │    ├── web (REACT-WEB)
  lerna.json
  package.json

Script Description

  "scripts": {
    "pre": "lerna clean --yes && lerna bootstrap && yarn build:lib,
    "build": "lerna run build --scope={web,app,@lib/common}",
    "web": "yarn workspace web start",
    "ios": "lerna run ios --scope=app --stream -- --ios",
    "ios": "lerna run ios --scope=app --stream -- --android",
    "expo": "lerna --scope=app run start --stream --",
    "postinstall": "yarn --cwd packages/app postinstall"
  },

[clean]: node_modules 초기화 [build]: workspace scope 해당만큼 build [web]: react web project 실행 [ios]: expo project web ios 실행 [android]: expo project android 실행

lerna 사용법

[workspaces 조회]

yarn workspaces info

[의존성 추가]

$ yarn add -W "워크스페이스" "libery"

[패키지 의존을 설치]

yarn lerna bootstrap

[clean node_modules 초기화]

$ yarn lerna clean

Reference