pnpm으로 workspace를 통한 mone-repo 구현 #24
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.
🔧 기본 CRA 설정과 CRA의 독릭적 파일 생성
CRA template TypeScript 설치
Eslint(ver.8.22.0), Prettier 설치
TailwindCSS, CVA 설치
react-router-dom 설치
현재 까지의 디렉토리 구조
현재 디렉토리 구조
🛠Mono-repo 구현하기
📌npmrc 설정(여기서 pnp 방식으로 설정이 가능한다.)
📌package.json 루트에 생성하기
📌workspace 설정
package.json workspace 설정
pnpm-workspace.yaml
루트에 front workspace 의존성들 설치
front 디렉토리에 있는 node_modules 삭제
현재 까지의 디렉토리 구조
현재 디렉토리 구조
root에 eslint와 prettier를 설치하지 않는 이유
front 디렉토리에 node_modules가 생기는 이유
root node_modules
pnpm의 add와 install의 차이
pnpm add ~를 사용하면 패키지를 설치할 뿐만 아니라 설치한 패키지를 package.json의 dependencies나 devDependencies에 자동으로 추가하게 된다.
pnpm install ~은 패키지 추가를 위한 명령어가 아니며 package.json에 이미 정의된 의존성들을 설치하는 데 사용된다.
이전 pnpm으로 설치를 할때 add와 install을 혼용해서 사용했다. 이로 인해서 pnpm으로 eslint를 설치할 때 발생하는 문제들이 많았으며 이해가 되지 않는 package.json의 형태가 나타 났었다.