Frontend

yarn으로 패키지 설치할 때 .gitignore 작성법

전예방 2023. 11. 7. 00:18

yarn으로 패키지를 설치하니까

.yarn 파일이 엄청 많이 생겼다.

 

그것도 모르고 터미널로... git add . 해버렸더니... 깃헙 레파지토리에 올라가질 않는다...ㅎㅎㅎ

ㅠㅠㅠ

 

그래서 그냥 프젝 다시 파서 하기로...

초기에 알아서 다행이다.

 

이 글을 참고했다.

 

Am I meant to commit yarn's `.pnp.js` file?

Yarn includes an optional "Plug'n'Play" feature which moves node_modules out of the project directory. In doing so it creates a .pnp.js file with references to various dependency paths on the hard ...

stackoverflow.com

stackoverflow에 보니까 Zero-Installs ?? 이라는게 있는데

yarn zero install에 대해서 찾아봐야할 것 같다.

# ------- yarn -------
# see excellent notes at: https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
# Also: `yarn.lock` and `.yarnrc.yml` (or it's older counterpart .yarnrc) "should always be stored in your repo"
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

## --> ADD if using zero-install, otherwise do NOT:
#!.yarn/cache

## --> ELSE ADD if NOT using yarn's zero-install:
.pnp.*

# ------- end yarn -------

 

# gitignore 만들어주는 사이트

 

gitignore.io

Create useful .gitignore files for your project

www.toptal.com

 

# gitignore 작성하는 법

 

[Git] .gitignore 사용해 git에 추가되지 말아야 할 파일 정의하기

.gitignore 파일이란? .gitignore 파일은 Git의 root 디렉토리에 저장되어, Git Repository나 Staging Area에 추가되지 말아야 하는(무시되어야 하는) 폴더나 파일을 정의하는 파일이다. .gitignore에 정의된 파일은

kotlinworld.com

 

'Frontend' 카테고리의 다른 글

firebase 배포하는 방법  (0) 2024.09.16
구글 앱 비밀번호 생성하는 방법  (0) 2024.01.03
nvm 명령어  (1) 2023.12.22
JSON Generator, 그 외 JSON 관련 유용한 사이트  (0) 2023.11.04

'Frontend'의 다른글

  • 현재글 yarn으로 패키지 설치할 때 .gitignore 작성법

관련글