[git] git workspace 환경 세팅 방법

FE-leejinw·2023년 5월 9일

git

목록 보기
1/1

package.json 초기화

프로젝트의 가장 루트 경로에서 아래의 명령어를 통해 package.json 을 초기화한다.

명령어

$yarn init -y

package.json

{
  "name": "project--portfolio--nextjs",
  "version": "1.0.0",
  "main": "index.js",
  "repository": "https://github.com/dlwlsdn201/project--portfolio--nextjs.git",
  "author": "JinWoo_Lee <dlwlsdn201@naver.com>",
  "license": "MIT"
}

workspace 정의

package.json

{
  (...)
  "workspace": ["client", "server"]
  "private": true,
}

scripts 정의

package.json

{
  (...)
  "scripts": {
    "client": "yarn workspace client start",
    "client:build": "yarn workspace client next build",
    "server": "yarn workspace server start"
  },
}

workspace의 package.json 초기화

client, server 각각 workspace 경로에서 아래의 명령어를 통해 package.json을 초기화(생성) 시켜준다.

명령어

$git init -y

이후 부터는 각각에 필요한 패키지들을 설치하면서 개발하면 된다.

profile
엄청 똑똑하진 않아도 꾸준히 하는 것에 보람을 즐기는 그러한 개발자라고 할 수 있겠다💡

0개의 댓글