2021-01-18 TIL

정리

웹 개발 환경 세팅

  1. npm init -y
  2. npm install -D webpack webpack-cli webpack-dev-server
  3. npm i -D eslint
  4. npx eslint —init

    • import/export
    • react
    • n
    • browser
    • use a popular
    • airbnb
    • js
    • y
    • y
    • npx eslint 파일명
    • npx eslint —fix
  5. webpack-devserver 실행

    • npx webpack-dev-server
  6. babel

    • npm i -D babel-loader : 웹팩에서 바벨을 쓸 수 있도록 도와줌.
    • webpack.config.js : 웹팩 설정 파일
    • npm i -D babel-core : 웹팩을 돌리기 위해 바벨 코어가 필요함.
    • babel.config.js : 바벨 설정 파일 프리셋을 쓸것임.
    • npm i -D @babel/preset-env @babel/preset-react
  7. 태그 안에 class를 넣을 수 있지만 jsx 에선 실제 class 예약어와 겹칠 수 있으니 className으로 바꿔줘야한다.

5F

1.Fact

- DOM(Document object Model)은 HTML, XML 문서의 프로그래밍 interface이다.
- DOM은 프로그램으로 문서의 구조, 스타일, 내용을 바꾸게 해준다.
- js는 dom을 사용하여 문서와 요소에 접근한다.
- document와 window로 쉽게 접근할 수 있다.

Written by@Zero1
This blog is for that I organize what I study and my thinking, feeling and experience.

GitHub