NX 모노레포 사용법정리

김영덕·2023년 11월 18일
0
post-thumbnail

업로드중..

워크스페이스 설치


//생성
npx create-nx-workspace

추가세팅


//next 추가
npm install --save-dev @nx/next
//tailwind 추가
nx g @nx/react:setup-tailwind

프로젝트/라이브러리 명령어



'주의 : 라이브러리 생성해서 app에 넣으면 바로 읽지못함 app 재실행필요.'
//생성
	npx nx g @nx/react:app prname --directory=apps/prname
	npx nx g @nx/next:app prname
	npx nx g @nx/react:library products --directory=libs/products --unitTestRunner=vitest --bundler=none
	npx nx g @nx/react:library shared-ui --directory=libs/shared/ui --unitTestRunner=vitest --bundler=none
	npx nx g @nx/next:library nextUI --directory=libs/nextUI --unitTestRunner=vitest --bundler=none
//실행
	npx nx serve prname
//삭제
	npx nx generate @nx/workspace:remove --projectName=prname
//빌드
	npx nx build prname
profile
CodeMonkey탈출기

0개의 댓글