배포
웹 사이트에 게시할 파일을 빌드하기 위해서 아래 명령을 실행합니다.
- npm
- Yarn
- pnpm
npm run build
yarn build
pnpm run build
Once it finishes, the static files will be generated within the build
directory.
참고
The only responsibility of Docusaurus is to build your site and emit static files in build
.
만들어진 정적 파일을 어떻게 호스팅할 것인지는 여러분에게 달려 있습니다.
You can deploy your site to static site hosting services such as Vercel, GitHub Pages, Netlify, Render, and Surge.
도큐사우루스 사이트는 정적 렌더링 방식을 사용합니다. 자바스크립트가 없이도 잘 동작합니다.
Configuration
The following parameters are required in docusaurus.config.js
to optimize routing and serve files from the correct location:
옵션명 | 설명 |
---|---|
url | 사이트의 URL을 설정합니다. For a site deployed at https://my-org.com/my-project/ , url is https://my-org.com/ . |
baseUrl | 트레일링 슬래시를 포함한 프로젝트 Base URL을 설정합니다. For a site deployed at https://my-org.com/my-project/ , baseUrl is /my-project/ . |
Testing your Build Locally
실제 배포 작업을 진행하기 전에 로컬에서 빌드 테스트를 진행해야 합니다. Docusaurus provides a docusaurus serve
command for that:
- npm
- Yarn
- pnpm
npm run serve
yarn serve