[Bundler] CLI로 Parcel 적용해보기

Toproot·2021년 9월 3일
0

Bundler

목록 보기
2/4
post-thumbnail

CLI & Parcel

Parcel

Parcel

🖥 커맨드 라인 인터페이스(CLI)

커맨드 라인 인터페이스(CLI)

  • 필요에 따라 옵션을 선택해서 사용하기!!

  • Serve : 개발용 서버 시작

    parcel index.html
  • Build

    parcel build index.html

dist : 결과물 디렉토리

  • 디렉토리 이름 변경
parcel build entry.js --out-dir build.output

# or

parcel build entyr.js -d build/output

포트번호

  • 기본값 : 1234
// 변경하고자 할때.
parcel serve entry.js --port 1111

브라우저에서 열기

  • 기본값 : 비활성
parcel entry.js --open

빠른 모듈 교체 비활성화

  • 기본값: HMR 활성
    • HMR : 빠른 모듈교체(Hot Module Replacement)는 런타임에 페이지 새로고침 없이 수정된 내용을 자동으로 갱신하는 방식을 말합니다.
parcel entry.js --no-hmr

파일시스템 캐시 비활성화

  • 기본값 : 캐시 활성
parcel build entry.js --no-cache
- 캐시 비활성화 상태에서 개발서버 오픈, 제품화 가능
- 속도는 조금 저하 되지만 매번 새로운 결과물을 만들어 낼 수 있는 옵션.
profile
어디로 튈 지 모르는 개발자 로그 🛴

0개의 댓글