Skip to content

octave08/lerna-yarn-monorepo-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lerna-nextjs-storybook

  • lernayarn workspace를 이용하여 nextjs와 ui components 패키지를 분리
  • ui components는 storybook을 이용하여 개발할 수 있도록 환경 구성

Spec

  • TypeScript
  • Lerna
  • React
  • NextJS
  • Storybook
  • yarn workspace
  • microbundle
  • eslint & prettier
  • testing-library/react
  • cypress

기본 설정

루트에 공통의 라이브러리 설치

yarn add react -W // -W 옵션 사용

개별 라이브러리는 패키지 내에서 설치

cd <your-package>
yarn add storybook

nextjs와 ui components를 동시에 개발자 모드로 실행

lerna run dev --parallel // --parallel 옵션 사용

이슈

testling-library 적용 과정에서

Support for the experimental syntax 'jsx' isn't currently enabled

SyntaxError: Cannot use import statement outside a module

Error: Jest: Failed to parse the TypeScript config

TypeError: Cannot read properties of undefined (reading 'createElement')

monorepo 구성

Can't find module when using monorepo