parcel 초기세팅 / 설정 방법

npm 초기화 및 parcel-bundler devDependencies 설치

1. $ npm init -y
2. $ npm i -D parcel-bundler

scripts에 하기 내용 추가

// package.json

"scripts": {
    "dev": "parcel index.html",
    "build": "parcel build index.html"
  },

폴더, 파일 추가

index.html
js/main.js
scss/main.scss
reset.css
public/* // 이미지 파일 관련

이미지 파일을 자동으로 dist 폴더에 넣을 수 있게 해주는 라이브러리 설치

$ npm install -D parcel-plugin-static-files-copy

postcss, autoprefixer 설치

$ npm i -D postcss autoprefixer

package.json에 하기 내용 추가

"browserslist": [
    "> 1%", // 전세계 점유율 1% 이상의 모든 브라우저 지원
    "last 2 versions" // 마지막 2개의 버전 지원
  ]

.postcssrc.js

// 뒤에 rc(Runtime Configuration) 

[마켓로그] parcel 설정

npm init -y
npm i parcel sass prettier -D
npm i navigo dotenv chartjs

// package.json
"scripts": {
    "dev": "parcel index.html",
    "build": "parcel build index.html"
  },

"main": "index.js", -> "source": "index.html"

Last updated