yarn-workspace 구성하기 #2
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
yarn 설치
ver.1.22.22
) 확인하기yarn-berry 설치
yarn-berry 설치하기 위한 명령어
yarn(-berry) 버전(
ver.4.4.1
) 확인하기설치 후 package.json 구성
PnP 구성하기
yarn vsc에 yarn을 연동할 수 있는 Sdk 설정
yarn dlx @yarnpkg/sdks vscode
명령어는 Yarn Plug'n'Play (PnP) 환경에서 VSCode와 같은 편집기가 Yarn PnP 의존성 관리 방식을 인식하고 제대로 동작할 수 있도록 설정하기 위해 필요yarn dlx @yarnpkg/sdks vscode
로 인한 .vsccde (자동)구성node_modules와 package-lock.json 삭제
모든 패키지들을 PnP의 읜존성을 부여하기위해 node_modules와 package-lock.json을 삭제한다.
.yarnrc.yml에 PnP를 위한 설정
Zeroinstall
yarn-workspace 구성하기
yarn-worksapce를 구성하기 위해서는 package.json에 worksapce를 라는 문법을 삽입하면 된다.
- root/package.json
/*--이하생략--*/ "workspaces": [ "trends/*" ], /*--이하생략--*/
.yarn
에서 관리할 수 있도록 하려고 했으나 의존성 관리 복잡성으로 각 프로젝트 하위 로컬을 통해서 관리할 수 있도록 구성 했다.REF
git rm -r --cached .vscode/
git 명령어를 사용해서 제거 하면 된다.Summary