본문 바로가기

React

내가 만든 것을 빌드와 배포를 해보자!!! ( feat. React 편)

빌드와 배포의 의미는 

 

빌드 

 

소스 코드 파일을 컴퓨터나 휴대폰에서 실행할 수 있는 독립 소프트웨어 가공물로  변환하는 과정을 의미합니다.

 

배포

 

나의 개발해서 빌드한 어플을 사용자에게 전달하는 과정을 의미합니다.


리액트에서는 
빌드는 build 명령어로
배포는 serve 명령어로
가능합니다.

 

 

1. build 명령어로 통해서  컴퓨터에서 실행할수 있는 소프트웨어로 변경합니다.

andan@LAPTOP-7I2GF3EM MINGW64 ~/Desktop/gitStory/my-ui-app (dev)
$ npm run build

> my-ui-app@0.1.0 build
> react-scripts build

Creating an optimized production build...
One of your dependencies, babel-preset-react-app, is importing the
"@babel/plugin-proposal-private-property-in-object" package without
declaring it in its dependencies. This is currently working because
"@babel/plugin-proposal-private-property-in-object" is already in your
node_modules folder for unrelated reasons, but it may break at any time.

babel-preset-react-app is part of the create-react-app project, which
is not maintianed anymore. It is thus unlikely that this bug will
ever be fixed. Add "@babel/plugin-proposal-private-property-in-object" to
your devDependencies to work around this error. This will make this message
go away.

Compiled successfully.

File sizes after gzip:

  74.21 kB  build\static\js\main.c3109841.js
  1.77 kB   build\static\js\453.135a8f00.chunk.js
  263 B     build\static\css\main.e6c13ad2.css

The project was built assuming it is hosted at /.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.
You may serve it with a static server:

  npm install -g serve
  serve -s build

Find out more about deployment here:

  https://cra.link/deployment

 

2.  build가 종료되면  배포(deploy) 관련 도움말이 끝에 나옵니다. 

serve 명령어를 설치하고  이용하라는것이군요

다음 두 명령어를 이용해서 배포되게 해봅시다.

local address를  웹 브라우저 창에 복사하고 엔터해봅시다.

 

 

 

정리하자면 

 

   저희는  오늘  로컬 환경( = 저의 노트북) 에서 리액트 프로젝트를 만들었고  로컬에서 

   빌드하고 배포했습니다.